Merge branch 'rc/1.23.1' into release

This commit is contained in:
Benjamin Doherty
2022-06-06 15:16:53 -07:00
837 changed files with 36608 additions and 32799 deletions
-4
View File
@@ -687,10 +687,6 @@ if (FILAMENT_SUPPORTS_VULKAN)
add_subdirectory(${EXTERNAL}/vkmemalloc/tnt)
endif()
if (APPLE)
add_subdirectory(${EXTERNAL}/moltenvk/tnt)
endif()
set(FILAMENT_SAMPLES_BINARY_DIR ${PROJECT_BINARY_DIR}/samples)
if (WEBGL)
+2 -2
View File
@@ -31,7 +31,7 @@ repositories {
}
dependencies {
implementation 'com.google.android.filament:filament-android:1.23.0'
implementation 'com.google.android.filament:filament-android:1.23.1'
}
```
@@ -51,7 +51,7 @@ Here are all the libraries available in the group `com.google.android.filament`:
iOS projects can use CocoaPods to install the latest release:
```
pod 'Filament', '~> 1.23.0'
pod 'Filament', '~> 1.23.1'
```
### Snapshots
+11
View File
@@ -5,6 +5,17 @@ A new header is inserted each time a *tag* is created.
## main branch
## v1.23.1
- gltfio: support skinning with bones that do not belong to any scene.
- gltfio: add `attachSkin` / `detachSkin` method to FilamentAsset.
- gltfio: ubershader mode: set sheen to `OPAQUE`.
- Metal: fix issues seen with dynamic resolution on M1 Macs.
- engine: add a "global" mode for render primitive's `blendOrder`.
- engine: remove `RenderManager::setGeometryAt(index, count)`. [⚠️ **API Change**]
- engine: fix overallocation by about 17MB.
- WebGL: Add JS bindings for Texture class methods.
## v1.23.0
- engine: Changed UBOs layout [⚠️ **Material breakage**].
@@ -120,6 +120,14 @@ Java_com_google_android_filament_RenderableManager_nBuilderBlendOrder(JNIEnv*, j
builder->blendOrder((size_t) index, (uint16_t) blendOrder);
}
extern "C"
JNIEXPORT void JNICALL
Java_com_google_android_filament_RenderableManager_nBuilderGlobalBlendOrderEnabled(JNIEnv*, jclass,
jlong nativeBuilder, jint index, jboolean enabled) {
RenderableManager::Builder *builder = (RenderableManager::Builder *) nativeBuilder;
builder->globalBlendOrderEnabled((size_t) index, (bool) enabled);
}
extern "C" JNIEXPORT void JNICALL
Java_com_google_android_filament_RenderableManager_nBuilderBoundingBox(JNIEnv*, jclass,
jlong nativeBuilder, jfloat cx, jfloat cy, jfloat cz, jfloat ex, jfloat ey, jfloat ez) {
@@ -422,15 +430,6 @@ Java_com_google_android_filament_RenderableManager_nSetGeometryAt__JIIIJJII(JNIE
(size_t) offset, (size_t) count);
}
extern "C" JNIEXPORT void JNICALL
Java_com_google_android_filament_RenderableManager_nSetGeometryAt__JIIIII(JNIEnv*, jclass,
jlong nativeRenderableManager, jint i, jint primitiveIndex, jint primitiveType, jint offset,
jint count) {
RenderableManager *rm = (RenderableManager *) nativeRenderableManager;
rm->setGeometryAt((RenderableManager::Instance) i, (size_t) primitiveIndex,
(RenderableManager::PrimitiveType) primitiveType, (size_t) offset, (size_t) count);
}
extern "C" JNIEXPORT void JNICALL
Java_com_google_android_filament_RenderableManager_nSetBlendOrderAt(JNIEnv*, jclass,
jlong nativeRenderableManager, jint i, jint primitiveIndex, jint blendOrder) {
@@ -439,6 +438,14 @@ Java_com_google_android_filament_RenderableManager_nSetBlendOrderAt(JNIEnv*, jcl
(uint16_t) blendOrder);
}
extern "C" JNIEXPORT void JNICALL
Java_com_google_android_filament_RenderableManager_nSetGlobalBlendOrderEnabledAt(JNIEnv*, jclass,
jlong nativeRenderableManager, jint i, jint primitiveIndex, jboolean enabled) {
RenderableManager *rm = (RenderableManager *) nativeRenderableManager;
rm->setGlobalBlendOrderEnabledAt((RenderableManager::Instance) i, (size_t) primitiveIndex,
(bool) enabled);
}
extern "C" JNIEXPORT jint JNICALL
Java_com_google_android_filament_RenderableManager_nGetEnabledAttributesAt(JNIEnv*, jclass,
jlong nativeRenderableManager, jint i, jint primitiveIndex) {
@@ -191,7 +191,9 @@ public class RenderableManager {
}
/**
* Sets an ordering index for blended primitives that all live at the same Z value.
* Sets the drawing order for blended primitives. The drawing order is either global or
* local (default) to this Renderable. In either case, the Renderable priority takes
* precedence.
*
* @param index the primitive of interest
* @param blendOrder draw order number (0 by default). Only the lowest 15 bits are used.
@@ -203,6 +205,18 @@ public class RenderableManager {
return this;
}
/**
* Sets whether the blend order is global or local to this Renderable (by default).
*
* @param index the primitive of interest
* @param enabled true for global, false for local blend ordering.
*/
@NonNull
public Builder globalBlendOrderEnabled(@IntRange(from = 0) int index, boolean enabled) {
nBuilderGlobalBlendOrderEnabled(mNativeBuilder, index, enabled);
return this;
}
/**
* The axis-aligned bounding box of the renderable.
*
@@ -792,18 +806,9 @@ public class RenderableManager {
0, indices.getIndexCount());
}
/**
* Changes the geometry for the given primitive.
*
* @see Builder#geometry Builder.geometry
*/
public void setGeometryAt(@EntityInstance int i, @IntRange(from = 0) int primitiveIndex,
@NonNull PrimitiveType type, @IntRange(from = 0) int offset, @IntRange(from = 0) int count) {
nSetGeometryAt(mNativeObject, i, primitiveIndex, type.getValue(), offset, count);
}
/**
* Changes the ordering index for blended primitives that all live at the same Z value.
/**
* Changes the drawing order for blended primitives. The drawing order is either global or
* local (default) to this Renderable. In either case, the Renderable priority takes precedence.
*
* @see Builder#blendOrder
*
@@ -816,6 +821,20 @@ public class RenderableManager {
nSetBlendOrderAt(mNativeObject, instance, primitiveIndex, blendOrder);
}
/**
* Changes whether the blend order is global or local to this Renderable (by default).
*
* @see Builder#globalBlendOrderEnabled
*
* @param instance the renderable of interest
* @param primitiveIndex the primitive of interest
* @param enabled true for global, false for local blend ordering.
*/
public void setGlobalBlendOrderEnabledAt(@EntityInstance int instance, @IntRange(from = 0) int primitiveIndex,
boolean enabled) {
nSetGlobalBlendOrderEnabledAt(mNativeObject, instance, primitiveIndex, enabled);
}
/**
* Retrieves the set of enabled attribute slots in the given primitive's VertexBuffer.
*/
@@ -853,6 +872,7 @@ public class RenderableManager {
private static native void nBuilderGeometry(long nativeBuilder, int index, int value, long nativeVertexBuffer, long nativeIndexBuffer, int offset, int minIndex, int maxIndex, int count);
private static native void nBuilderMaterial(long nativeBuilder, int index, long nativeMaterialInstance);
private static native void nBuilderBlendOrder(long nativeBuilder, int index, int blendOrder);
private static native void nBuilderGlobalBlendOrderEnabled(long nativeBuilder, int index, boolean enabled);
private static native void nBuilderBoundingBox(long nativeBuilder, float cx, float cy, float cz, float ex, float ey, float ez);
private static native void nBuilderLayerMask(long nativeBuilder, int select, int value);
private static native void nBuilderPriority(long nativeBuilder, int priority);
@@ -891,7 +911,7 @@ public class RenderableManager {
private static native void nSetMaterialInstanceAt(long nativeRenderableManager, int i, int primitiveIndex, long nativeMaterialInstance);
private static native long nGetMaterialInstanceAt(long nativeRenderableManager, int i, int primitiveIndex);
private static native void nSetGeometryAt(long nativeRenderableManager, int i, int primitiveIndex, int primitiveType, long nativeVertexBuffer, long nativeIndexBuffer, int offset, int count);
private static native void nSetGeometryAt(long nativeRenderableManager, int i, int primitiveIndex, int primitiveType, int offset, int count);
private static native void nSetBlendOrderAt(long nativeRenderableManager, int i, int primitiveIndex, int blendOrder);
private static native void nSetGlobalBlendOrderEnabledAt(long nativeRenderableManager, int i, int primitiveIndex, boolean enabled);
private static native int nGetEnabledAttributesAt(long nativeRenderableManager, int i, int primitiveIndex);
}
+6 -2
View File
@@ -23,6 +23,10 @@ add_library(basis_transcoder STATIC IMPORTED)
set_target_properties(basis_transcoder PROPERTIES IMPORTED_LOCATION
${FILAMENT_DIR}/lib/${ANDROID_ABI}/libbasis_transcoder.a)
add_library(zstd STATIC IMPORTED)
set_target_properties(zstd PROPERTIES IMPORTED_LOCATION
${FILAMENT_DIR}/lib/${ANDROID_ABI}/libzstd.a)
add_library(utils STATIC IMPORTED)
set_target_properties(utils PROPERTIES IMPORTED_LOCATION
${FILAMENT_DIR}/lib/${ANDROID_ABI}/libutils.a)
@@ -108,9 +112,9 @@ set_target_properties(gltfio-jni PROPERTIES LINK_DEPENDS ${CMAKE_CURRENT_SOURCE_
if(GLTFIO_LITE)
target_compile_definitions(gltfio-jni PUBLIC GLTFIO_LITE=1)
target_link_libraries(gltfio-jni filament-jni utils log stb ktxreader basis_transcoder gltfio_resources_lite)
target_link_libraries(gltfio-jni filament-jni utils log stb ktxreader basis_transcoder zstd gltfio_resources_lite)
else()
target_link_libraries(gltfio-jni filament-jni utils log stb ktxreader basis_transcoder gltfio_resources)
target_link_libraries(gltfio-jni filament-jni utils log stb ktxreader basis_transcoder zstd gltfio_resources)
# Enable Draco in the non-lite variant of gltfio.
target_link_libraries(gltfio-jni dracodec)
@@ -340,3 +340,19 @@ Java_com_google_android_filament_gltfio_FilamentAsset_nReleaseSourceData(JNIEnv*
FilamentAsset* asset = (FilamentAsset*) nativeAsset;
asset->releaseSourceData();
}
extern "C" JNIEXPORT void JNICALL
Java_com_google_android_filament_gltfio_FilamentAsset_nAttachSkin(JNIEnv* env, jclass,
jlong nativeAsset, jint skinIndex, jint targetEntity) {
FilamentAsset* asset = (FilamentAsset*) nativeAsset;
Entity target = Entity::import(targetEntity);
asset->attachSkin(skinIndex, target);
}
extern "C" JNIEXPORT void JNICALL
Java_com_google_android_filament_gltfio_FilamentAsset_nDetachSkin(JNIEnv* env, jclass,
jlong nativeAsset, jint skinIndex, jint targetEntity) {
FilamentAsset* asset = (FilamentAsset*) nativeAsset;
Entity target = Entity::import(targetEntity);
asset->detachSkin(skinIndex, target);
}
@@ -241,17 +241,37 @@ public class FilamentAsset {
return result;
}
/**
* Attaches the given skin to the given node, which must have an associated mesh with
* BONE_INDICES and BONE_WEIGHTS attributes.
*
* This is a no-op if the given skin index or target is invalid.
*/
public void attachSkin(@IntRange(from = 0) int skinIndex, @Entity int target) {
nAttachSkin(getNativeObject(), skinIndex, target);
}
/**
* Attaches the given skin to the given node, which must have an associated mesh with
* BONE_INDICES and BONE_WEIGHTS attributes.
*
* This is a no-op if the given skin index or target is invalid.
*/
public void detachSkin(@IntRange(from = 0) int skinIndex, @Entity int target) {
nDetachSkin(getNativeObject(), skinIndex, target);
}
/**
* Gets the joint count at skin index in this asset.
*/
public int getJointCountAt(int skinIndex) {
public int getJointCountAt(@IntRange(from = 0) int skinIndex) {
return nGetJointCountAt(getNativeObject(), skinIndex);
}
/**
* Gets joints at skin index in this asset.
*/
public @NonNull @Entity int[] getJointsAt(int skinIndex) {
public @NonNull @Entity int[] getJointsAt(@IntRange(from = 0) int skinIndex) {
int[] result = new int[getJointCountAt(skinIndex)];
nGetJointsAt(getNativeObject(), skinIndex, result);
return result;
@@ -345,6 +365,9 @@ public class FilamentAsset {
private static native int nGetMorphTargetCount(long nativeAsset, int entity);
private static native void nGetMorphTargetNames(long nativeAsset, int entity, String[] result);
private static native void nAttachSkin(long nativeAsset, int skinIndex, int entity);
private static native void nDetachSkin(long nativeAsset, int skinIndex, int entity);
private static native void nGetBoundingBox(long nativeAsset, float[] box);
private static native String nGetName(long nativeAsset, int entity);
private static native String nGetExtras(long nativeAsset, int entity);
+1 -1
View File
@@ -1,5 +1,5 @@
GROUP=com.google.android.filament
VERSION_NAME=1.23.0
VERSION_NAME=1.23.1
POM_DESCRIPTION=Real-time physically based rendering engine for Android.
+1 -1
View File
@@ -7,7 +7,7 @@ Deprecated==1.2.13
idna==3.3
pycparser==2.21
PyGithub==1.55
PyJWT==2.3.0
PyJWT==2.4.0
PyNaCl==1.5.0
requests==2.27.1
urllib3==1.26.9
+1
View File
@@ -131,6 +131,7 @@ set(SRCS
set(PRIVATE_HDRS
src/Allocators.h
src/BufferPoolAllocator.h
src/ColorSpace.h
src/Culler.h
src/DFG.h
+3
View File
@@ -49,6 +49,9 @@ To use the Vulkan backend on macOS you must also make the following libraries av
- `libMoltenVK.dylib`
- `libvulkan.1.dylib`
The easiest way to install those files is to use the macOS
[LunarG Vulkan SDK](https://www.lunarg.com/vulkan-sdk/) installer.
## Linking against Filament
This walkthrough will get you successfully compiling and linking native code
-13
View File
@@ -438,16 +438,3 @@ if (APPLE AND NOT IOS)
target_link_libraries(backend_test_mac PRIVATE -force_load backend_test)
endif()
if (APPLE AND NOT Vulkan_LIBRARY AND NOT FILAMENT_USE_SWIFTSHADER)
message(STATUS "No Vulkan SDK was found, using prebuilt MoltenVK.")
set(MOLTENVK_DIR "../../third_party/moltenvk")
configure_file(
${MOLTENVK_DIR}/libvulkan.1.dylib
${PROJECT_BINARY_DIR}/libvulkan.1.dylib COPYONLY)
configure_file(
${MOLTENVK_DIR}/MoltenVK_icd.json
${PROJECT_BINARY_DIR}/MoltenVK_icd.json COPYONLY)
configure_file(
${MOLTENVK_DIR}/libMoltenVK.dylib
${PROJECT_BINARY_DIR}/libMoltenVK.dylib COPYONLY)
endif()
@@ -732,7 +732,7 @@ enum class SamplerCompareFunc : uint8_t {
N //!< Never. The depth / stencil test always fails.
};
//! Sampler paramters
//! Sampler parameters
struct SamplerParams { // NOLINT
union {
struct {
@@ -217,7 +217,14 @@ DECL_DRIVER_API_R_N(backend::TextureHandle, importTexture,
DECL_DRIVER_API_R_N(backend::SamplerGroupHandle, createSamplerGroup,
uint32_t, size)
DECL_DRIVER_API_R_0(backend::RenderPrimitiveHandle, createRenderPrimitive)
DECL_DRIVER_API_R_N(backend::RenderPrimitiveHandle, createRenderPrimitive,
backend::VertexBufferHandle, vbh,
backend::IndexBufferHandle, ibh,
backend::PrimitiveType, pt,
uint32_t, offset,
uint32_t, minIndex,
uint32_t, maxIndex,
uint32_t, count)
DECL_DRIVER_API_R_N(backend::ProgramHandle, createProgram,
backend::Program&&, program)
@@ -377,19 +384,6 @@ DECL_DRIVER_API_0(endRenderPass)
DECL_DRIVER_API_0(nextSubpass)
DECL_DRIVER_API_N(setRenderPrimitiveBuffer,
backend::RenderPrimitiveHandle, rph,
backend::VertexBufferHandle, vbh,
backend::IndexBufferHandle, ibh)
DECL_DRIVER_API_N(setRenderPrimitiveRange,
backend::RenderPrimitiveHandle, rph,
backend::PrimitiveType, pt,
uint32_t, offset,
uint32_t, minIndex,
uint32_t, maxIndex,
uint32_t, count)
DECL_DRIVER_API_N(beginTimerQuery,
backend::TimerQueryHandle, query)
+6
View File
@@ -118,6 +118,12 @@ private:
mHandleAllocator.deallocate(handle, p);
}
inline void setRenderPrimitiveBuffer(Handle<HwRenderPrimitive> rph,
Handle<HwVertexBuffer> vbh, Handle<HwIndexBuffer> ibh);
inline void setRenderPrimitiveRange(Handle<HwRenderPrimitive> rph, PrimitiveType pt,
uint32_t offset, uint32_t minIndex, uint32_t maxIndex, uint32_t count);
void enumerateSamplerGroups(const MetalProgram* program, ShaderType shaderType,
const std::function<void(const SamplerGroup::Sampler*, size_t)>& f);
void enumerateBoundUniformBuffers(const std::function<void(const UniformBufferState&,
+18 -43
View File
@@ -278,8 +278,13 @@ void MetalDriver::createSamplerGroupR(Handle<HwSamplerGroup> sbh, uint32_t size)
mContext->samplerGroups.insert(construct_handle<MetalSamplerGroup>(sbh, size));
}
void MetalDriver::createRenderPrimitiveR(Handle<HwRenderPrimitive> rph, int dummy) {
void MetalDriver::createRenderPrimitiveR(Handle<HwRenderPrimitive> rph,
Handle<HwVertexBuffer> vbh, Handle<HwIndexBuffer> ibh,
PrimitiveType pt, uint32_t offset,
uint32_t minIndex, uint32_t maxIndex, uint32_t count) {
construct_handle<MetalRenderPrimitive>(rph);
MetalDriver::setRenderPrimitiveBuffer(rph, vbh, ibh);
MetalDriver::setRenderPrimitiveRange(rph, pt, offset, minIndex, maxIndex, count);
}
void MetalDriver::createProgramR(Handle<HwProgram> rph, Program&& program) {
@@ -1068,33 +1073,13 @@ void MetalDriver::blit(TargetBufferFlags buffers,
dstRect.left >= 0 && dstRect.bottom >= 0,
"Source and destination rects must be positive.");
// Metal's texture coordinates have (0, 0) at the top-left of the texture, but Filament's
// coordinates have (0, 0) at bottom-left.
const NSInteger srcHeight =
srcTarget->isDefaultRenderTarget() ?
mContext->currentReadSwapChain->getSurfaceHeight() : srcTarget->height;
MTLRegion srcRegion = MTLRegionMake2D(
(NSUInteger) srcRect.left,
srcHeight - (NSUInteger) srcRect.bottom - srcRect.height,
srcRect.width, srcRect.height);
const NSInteger dstHeight =
dstTarget->isDefaultRenderTarget() ?
mContext->currentDrawSwapChain->getSurfaceHeight() : dstTarget->height;
MTLRegion dstRegion = MTLRegionMake2D(
(NSUInteger) dstRect.left,
dstHeight - (NSUInteger) dstRect.bottom - dstRect.height,
dstRect.width, dstRect.height);
auto isBlitableTextureType = [](MTLTextureType t) {
return t == MTLTextureType2D || t == MTLTextureType2DMultisample ||
t == MTLTextureType2DArray;
};
MetalBlitter::BlitArgs args;
args.filter = filter;
args.source.region = srcRegion;
args.destination.region = dstRegion;
// MetalBlitter supports blitting color and depth simultaneously, but for simplicitly we'll blit
// them separately. In practice, Filament only ever blits a single buffer at a time anyway.
if (any(buffers & TargetBufferFlags::COLOR_ALL)) {
// We always blit from/to the COLOR0 attachment.
@@ -1106,12 +1091,17 @@ void MetalDriver::blit(TargetBufferFlags buffers,
isBlitableTextureType(dstColorAttachment.getTexture().textureType),
"Metal does not support blitting to/from non-2D textures.");
MetalBlitter::BlitArgs args;
args.filter = filter;
args.source.region = srcColorAttachment.getRegionFromClientRect(srcRect);
args.destination.region = dstColorAttachment.getRegionFromClientRect(dstRect);
args.source.color = srcColorAttachment.getTexture();
args.destination.color = dstColorAttachment.getTexture();
args.source.level = srcColorAttachment.level;
args.destination.level = dstColorAttachment.level;
args.source.slice = srcColorAttachment.layer;
args.destination.slice = dstColorAttachment.layer;
mContext->blitter->blit(getPendingCommandBuffer(mContext), args);
}
}
@@ -1124,34 +1114,19 @@ void MetalDriver::blit(TargetBufferFlags buffers,
isBlitableTextureType(dstDepthAttachment.getTexture().textureType),
"Metal does not support blitting to/from non-2D textures.");
MetalBlitter::BlitArgs args;
args.filter = filter;
args.source.region = srcDepthAttachment.getRegionFromClientRect(srcRect);
args.destination.region = dstDepthAttachment.getRegionFromClientRect(dstRect);
args.source.depth = srcDepthAttachment.getTexture();
args.destination.depth = dstDepthAttachment.getTexture();
if (args.blitColor()) {
// If blitting color, we've already set the source and destination levels and slices.
// Check that they match the requested depth levels/slices.
ASSERT_PRECONDITION(args.source.level == srcDepthAttachment.level,
"Color and depth source LOD must match. (%d != %d)",
args.source.level, srcDepthAttachment.level);
ASSERT_PRECONDITION(args.destination.level == dstDepthAttachment.level,
"Color and depth destination LOD must match. (%d != %d)",
args.destination.level, dstDepthAttachment.level);
ASSERT_PRECONDITION(args.source.slice == srcDepthAttachment.layer,
"Color and depth source layer must match. (%d != %d)",
args.source.slice, srcDepthAttachment.layer);
ASSERT_PRECONDITION(args.destination.slice == dstDepthAttachment.layer,
"Color and depth destination layer must match. (%d != %d)",
args.destination.slice, dstDepthAttachment.layer);
}
args.source.level = srcDepthAttachment.level;
args.destination.level = dstDepthAttachment.level;
args.source.slice = srcDepthAttachment.layer;
args.destination.slice = dstDepthAttachment.layer;
mContext->blitter->blit(getPendingCommandBuffer(mContext), args);
}
}
mContext->blitter->blit(getPendingCommandBuffer(mContext), args);
}
void MetalDriver::draw(PipelineState ps, Handle<HwRenderPrimitive> rph, uint32_t instanceCount) {
+10
View File
@@ -257,6 +257,16 @@ public:
return texture ? texture.pixelFormat : MTLPixelFormatInvalid;
}
MTLRegion getRegionFromClientRect(Viewport rect) {
// Convert the Filament rect into Metal texture coordinates, taking into account Metal's
// inverted texture space and the mip level. Note that the underlying Texture could be
// larger than the RenderTarget. Metal's texture coordinates have (0, 0) at the top-left
// of the texture, but Filament's coordinates have (0, 0) at bottom-left.
const auto mipheight = texture.height >> level;
return MTLRegionMake2D((NSUInteger)rect.left,
mipheight - (NSUInteger)rect.bottom - rect.height, rect.width, rect.height);
}
explicit operator bool() const {
return texture != nil;
}
-9
View File
@@ -262,15 +262,6 @@ void NoopDriver::endRenderPass(int) {
void NoopDriver::nextSubpass(int) {
}
void NoopDriver::setRenderPrimitiveBuffer(Handle<HwRenderPrimitive> rph,
Handle<HwVertexBuffer> vbh, Handle<HwIndexBuffer> ibh) {
}
void NoopDriver::setRenderPrimitiveRange(Handle<HwRenderPrimitive> rph,
PrimitiveType pt, uint32_t offset,
uint32_t minIndex, uint32_t maxIndex, uint32_t count) {
}
void NoopDriver::makeCurrent(Handle<HwSwapChain> drawSch, Handle<HwSwapChain> readSch) {
}
+27 -42
View File
@@ -431,11 +431,37 @@ void OpenGLDriver::createBufferObjectR(Handle<HwBufferObject> boh,
CHECK_GL_ERROR(utils::slog.e)
}
void OpenGLDriver::createRenderPrimitiveR(Handle<HwRenderPrimitive> rph, int) {
void OpenGLDriver::createRenderPrimitiveR(Handle<HwRenderPrimitive> rph,
Handle<HwVertexBuffer> vbh, Handle<HwIndexBuffer> ibh,
PrimitiveType pt, uint32_t offset,
uint32_t minIndex, uint32_t maxIndex, uint32_t count) {
DEBUG_MARKER()
auto& gl = mContext;
GLVertexBuffer const* const eb = handle_cast<const GLVertexBuffer*>(vbh);
GLIndexBuffer const* const ib = handle_cast<const GLIndexBuffer*>(ibh);
assert_invariant(ib->elementSize == 2 || ib->elementSize == 4);
GLRenderPrimitive* rp = handle_cast<GLRenderPrimitive*>(rph);
rp->gl.indicesSize = (ib->elementSize == 4u) ? 4u : 2u;
rp->gl.vertexBufferWithObjects = vbh;
rp->type = pt;
rp->offset = offset * rp->gl.indicesSize;
rp->count = count;
rp->minIndex = minIndex;
rp->maxIndex = maxIndex > minIndex ? maxIndex : rp->maxVertexCount - 1; // sanitize max index
glGenVertexArrays(1, &rp->gl.vao);
gl.bindVertexArray(&rp->gl);
// update the VBO bindings in the VAO
updateVertexArrayObject(rp, eb);
// this records the index buffer into the currently bound VAO
gl.bindBuffer(GL_ELEMENT_ARRAY_BUFFER, ib->gl.buffer);
CHECK_GL_ERROR(utils::slog.e)
}
@@ -2371,47 +2397,6 @@ GLsizei OpenGLDriver::getAttachments(AttachmentArray& attachments,
return attachmentCount;
}
void OpenGLDriver::setRenderPrimitiveBuffer(Handle<HwRenderPrimitive> rph,
Handle<HwVertexBuffer> vbh, Handle<HwIndexBuffer> ibh) {
DEBUG_MARKER()
auto& gl = mContext;
if (rph) {
GLRenderPrimitive* const rp = handle_cast<GLRenderPrimitive*>(rph);
GLVertexBuffer const* const eb = handle_cast<const GLVertexBuffer*>(vbh);
GLIndexBuffer const* const ib = handle_cast<const GLIndexBuffer*>(ibh);
assert_invariant(ib->elementSize == 2 || ib->elementSize == 4);
gl.bindVertexArray(&rp->gl);
CHECK_GL_ERROR(utils::slog.e)
rp->gl.indicesSize = (ib->elementSize == 4u) ? 4u : 2u;
rp->gl.vertexBufferWithObjects = vbh;
// update the VBO bindings in the VAO
updateVertexArrayObject(rp, eb);
// this records the index buffer into the currently bound VAO
gl.bindBuffer(GL_ELEMENT_ARRAY_BUFFER, ib->gl.buffer);
CHECK_GL_ERROR(utils::slog.e)
}
}
void OpenGLDriver::setRenderPrimitiveRange(Handle<HwRenderPrimitive> rph,
PrimitiveType pt, uint32_t offset,
uint32_t minIndex, uint32_t maxIndex, uint32_t count) {
DEBUG_MARKER()
GLRenderPrimitive* const rp = handle_cast<GLRenderPrimitive*>(rph);
rp->type = pt;
rp->offset = offset * rp->gl.indicesSize;
rp->count = count;
rp->minIndex = minIndex;
rp->maxIndex = maxIndex > minIndex ? maxIndex : rp->maxVertexCount - 1; // sanitize max index
}
// Sets up a scissor rectangle that automatically gets clipped against the viewport.
void OpenGLDriver::setViewportScissor(Viewport const& viewportScissor) noexcept {
auto& gl = mContext;
+6 -1
View File
@@ -405,8 +405,13 @@ void VulkanDriver::createSamplerGroupR(Handle<HwSamplerGroup> sbh, uint32_t coun
construct<VulkanSamplerGroup>(sbh, count);
}
void VulkanDriver::createRenderPrimitiveR(Handle<HwRenderPrimitive> rph, int) {
void VulkanDriver::createRenderPrimitiveR(Handle<HwRenderPrimitive> rph,
Handle<HwVertexBuffer> vbh, Handle<HwIndexBuffer> ibh,
PrimitiveType pt, uint32_t offset,
uint32_t minIndex, uint32_t maxIndex, uint32_t count) {
construct<VulkanRenderPrimitive>(rph);
VulkanDriver::setRenderPrimitiveBuffer(rph, vbh, ibh);
VulkanDriver::setRenderPrimitiveRange(rph, pt, offset, minIndex, maxIndex, count);
}
void VulkanDriver::destroyRenderPrimitive(Handle<HwRenderPrimitive> rph) {
@@ -133,6 +133,12 @@ private:
mHandleAllocator.deallocate(handle, ptr);
}
inline void setRenderPrimitiveBuffer(Handle<HwRenderPrimitive> rph,
Handle<HwVertexBuffer> vbh, Handle<HwIndexBuffer> ibh);
inline void setRenderPrimitiveRange(Handle<HwRenderPrimitive> rph, PrimitiveType pt,
uint32_t offset, uint32_t minIndex, uint32_t maxIndex, uint32_t count);
void refreshSwapChain();
void collectGarbage();
+2 -4
View File
@@ -58,10 +58,8 @@ TrianglePrimitive::TrianglePrimitive(filament::backend::DriverApi& driverApi,
BufferDescriptor indexBufferDesc(gIndices, sizeof(short) * 3);
mDriverApi.updateIndexBuffer(mIndexBuffer, std::move(indexBufferDesc), 0);
mRenderPrimitive = mDriverApi.createRenderPrimitive(0);
mDriverApi.setRenderPrimitiveBuffer(mRenderPrimitive, mVertexBuffer, mIndexBuffer);
mDriverApi.setRenderPrimitiveRange(mRenderPrimitive, PrimitiveType::TRIANGLES, 0, 0, 2, 3);
mRenderPrimitive = mDriverApi.createRenderPrimitive(
mVertexBuffer, mIndexBuffer, PrimitiveType::TRIANGLES, 0, 0, 2, 3);
}
void TrianglePrimitive::updateVertices(const filament::math::float2 vertices[3]) noexcept {
+32 -21
View File
@@ -876,6 +876,8 @@ TEST_F(BackendTest, BlitRegion) {
constexpr int kDstTexHeight = 384;
constexpr auto kDstTexFormat = TextureFormat::RGBA8;
constexpr int kNumLevels = 3;
constexpr int kSrcLevel = 1;
constexpr int kDstLevel = 0;
// Create a SwapChain and make it current. We don't really use it so the res doesn't matter.
auto swapChain = api.createSwapChainHeadless(256, 256, 0);
@@ -894,23 +896,12 @@ TEST_F(BackendTest, BlitRegion) {
SamplerType::SAMPLER_2D, kNumLevels, kDstTexFormat, 1, kDstTexWidth, kDstTexHeight, 1,
TextureUsage::SAMPLEABLE | TextureUsage::COLOR_ATTACHMENT);
// Create a RenderTarget for each texture's miplevel.
Handle<HwRenderTarget> srcRenderTargets[kNumLevels];
Handle<HwRenderTarget> dstRenderTargets[kNumLevels];
for (uint8_t level = 0; level < kNumLevels; level++) {
srcRenderTargets[level] = api.createRenderTarget( TargetBufferFlags::COLOR,
kSrcTexWidth >> level, kSrcTexHeight >> level, 1, { srcTexture, level, 0 }, {}, {});
dstRenderTargets[level] = api.createRenderTarget( TargetBufferFlags::COLOR,
kDstTexWidth >> level, kDstTexHeight >> level, 1, { dstTexture, level, 0 }, {}, {});
}
// Blit one-quarter of src level 1 to dst level 0.
const int srcLevel = 1;
Viewport srcRect = {
.left = (kSrcTexWidth >> srcLevel) / 2,
.bottom = (kSrcTexHeight >> srcLevel) / 2,
.width = (kSrcTexWidth >> srcLevel) / 2,
.height = (kSrcTexHeight >> srcLevel) / 2,
.left = 0,
.bottom = 0,
.width = (kSrcTexWidth >> kSrcLevel) / 2,
.height = (kSrcTexHeight >> kSrcLevel) / 2,
};
Viewport dstRect = {
.left = 10,
@@ -919,9 +910,18 @@ TEST_F(BackendTest, BlitRegion) {
.height = kDstTexHeight - 10,
};
api.blit(TargetBufferFlags::COLOR0, dstRenderTargets[0],
dstRect, srcRenderTargets[srcLevel],
srcRect, SamplerMagFilter::LINEAR);
// Create a RenderTarget for each texture's miplevel.
// We purposely set the render target width and height to smaller than the texture, to check
// that this case is handled correctly.
Handle<HwRenderTarget> srcRenderTarget =
api.createRenderTarget(TargetBufferFlags::COLOR, srcRect.width,
srcRect.height, 1, {srcTexture, kSrcLevel, 0}, {}, {});
Handle<HwRenderTarget> dstRenderTarget =
api.createRenderTarget(TargetBufferFlags::COLOR, kDstTexWidth >> kDstLevel,
kDstTexHeight >> kDstLevel, 1, {dstTexture, kDstLevel, 0}, {}, {});
api.blit(TargetBufferFlags::COLOR0, dstRenderTarget, dstRect, srcRenderTarget, srcRect,
SamplerMagFilter::LINEAR);
// Push through an empty frame to allow the texture to upload and the blit to execute.
api.beginFrame(0, 0);
@@ -931,7 +931,7 @@ TEST_F(BackendTest, BlitRegion) {
// Grab a screenshot.
ScreenshotParams params { kDstTexWidth, kDstTexHeight, "BlitRegion.png" };
api.beginFrame(0, 0);
dumpScreenshot(api, dstRenderTargets[0], &params);
dumpScreenshot(api, dstRenderTarget, &params);
api.commit(swapChain);
api.endFrame(0);
@@ -940,12 +940,23 @@ TEST_F(BackendTest, BlitRegion) {
executeCommands();
getDriver().purge();
// Check if the image matches perfectly to our golden run.
//
// TODO: for some reason, this test has very, very slight (as in one pixel) differences between
// OpenGL and Metal. So disable golden checking for now.
// Use the compare tool from ImageMagick to see visual differences:
// compare -verbose -metric mae BlitRegion_Metal.png BlitRegion_OpenGL.png difference.png
//
// const uint32_t expected = 0x74fa34ed;
// printf("Computed hash is 0x%8.8x, Expected 0x%8.8x\n", params.pixelHashResult, expected);
// EXPECT_TRUE(params.pixelHashResult == expected);
// Cleanup.
api.destroyTexture(srcTexture);
api.destroyTexture(dstTexture);
api.destroySwapChain(swapChain);
for (auto rt : srcRenderTargets) api.destroyRenderTarget(rt);
for (auto rt : dstRenderTargets) api.destroyRenderTarget(rt);
api.destroyRenderTarget(srcRenderTarget);
api.destroyRenderTarget(dstRenderTarget);
executeCommands();
}
+42 -15
View File
@@ -205,10 +205,12 @@ public:
* avoid using a separate View for the HUD. Note that priority is completely orthogonal to
* Builder::layerMask, which merely controls visibility.
*
* \see Builder::blendOrder()
* @param priority clamped to the range [0..7], defaults to 4; 7 is lowest priority
* (rendered last).
*
* The priority is clamped to the range [0..7], defaults to 4; 7 is lowest priority
* (rendered last).
* @return Builder reference for chaining calls.
*
* @see Builder::blendOrder(), RenderableManager::setBlendOrderAt()
*/
Builder& priority(uint8_t priority) noexcept;
@@ -337,17 +339,37 @@ public:
*/
Builder& morphing(uint8_t level, size_t primitiveIndex,
MorphTargetBuffer* morphTargetBuffer, size_t offset, size_t count) noexcept;
inline Builder& morphing(uint8_t level, size_t primitiveIndex,
MorphTargetBuffer* morphTargetBuffer) noexcept;
/**
* Sets an ordering index for blended primitives that all live at the same Z value.
* Sets the drawing order for blended primitives. The drawing order is either global or
* local (default) to this Renderable. In either case, the Renderable priority takes
* precedence.
*
* @param primitiveIndex the primitive of interest
* @param order draw order number (0 by default). Only the lowest 15 bits are used.
*
* @return Builder reference for chaining calls.
*
* @see globalBlendOrderEnabled
*/
Builder& blendOrder(size_t primitiveIndex, uint16_t order) noexcept;
/**
* Sets whether the blend order is global or local to this Renderable (by default).
*
* @param primitiveIndex the primitive of interest
* @param enabled true for global, false for local blend ordering.
*
* @return Builder reference for chaining calls.
*
* @see blendOrder
*/
Builder& globalBlendOrderEnabled(size_t primitiveIndex, bool enabled) noexcept;
/**
* Specifies the number of draw instance of this renderable. The default is 1 instance and
* the maximum number of instances allowed is 65535. 0 is invalid.
@@ -394,6 +416,7 @@ public:
MaterialInstance const* materialInstance = nullptr;
PrimitiveType type = PrimitiveType::TRIANGLES;
uint16_t blendOrder = 0;
bool globalBlendOrderEnabled = false;
struct {
MorphTargetBuffer* buffer = nullptr;
size_t offset = 0;
@@ -578,24 +601,28 @@ public:
size_t offset, size_t count) noexcept;
/**
* Changes the active range of indices or topology for the given primitive.
*
* \see Builder::geometry()
*/
void setGeometryAt(Instance instance, size_t primitiveIndex,
PrimitiveType type, size_t offset, size_t count) noexcept;
/**
* Changes the ordering index for blended primitives that all live at the same Z value.
*
* \see Builder::blendOrder()
* Changes the drawing order for blended primitives. The drawing order is either global or
* local (default) to this Renderable. In either case, the Renderable priority takes precedence.
*
* @param instance the renderable of interest
* @param primitiveIndex the primitive of interest
* @param order draw order number (0 by default). Only the lowest 15 bits are used.
*
* @see Builder::blendOrder(), setGlobalBlendOrderEnabledAt()
*/
void setBlendOrderAt(Instance instance, size_t primitiveIndex, uint16_t order) noexcept;
/**
* Changes whether the blend order is global or local to this Renderable (by default).
*
* @param instance the renderable of interest
* @param primitiveIndex the primitive of interest
* @param enabled true for global, false for local blend ordering.
*
* @see Builder::globalBlendOrderEnabled(), setBlendOrderAt()
*/
void setGlobalBlendOrderEnabledAt(Instance instance, size_t primitiveIndex, bool enabled) noexcept;
/**
* Retrieves the set of enabled attribute slots in the given primitive's VertexBuffer.
*/
+157
View File
@@ -0,0 +1,157 @@
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef TNT_FILAMENT_BUFFERPOOLALLOCATOR_H
#define TNT_FILAMENT_BUFFERPOOLALLOCATOR_H
#include <utils/Allocator.h>
#include <utils/FixedCapacityVector.h>
#include <utility>
#include <stdint.h>
#include <stdlib.h>
namespace filament {
/*
* A simple buffer pool-allocator. The pool has a fixed size and buffers held by the pool all have
* the same size which is defined by the most recent largest allocation request -- so buffers in the
* pool can only grow, unless the pool is reset. All buffers in the pool know their own size.
*/
template<size_t POOL_SIZE,
size_t ALIGNMENT = alignof(std::max_align_t),
typename AllocatorPolicy = utils::HeapAllocator,
typename LockingPolicy = utils::LockingPolicy::NoLock>
class BufferPoolAllocator {
public:
using size_type = uint32_t;
BufferPoolAllocator() = default;
// pool is not copyable
BufferPoolAllocator(BufferPoolAllocator const& rhs) = delete;
BufferPoolAllocator& operator=(BufferPoolAllocator const& rhs) = delete;
// pool is movable
BufferPoolAllocator(BufferPoolAllocator&& rhs) noexcept = default;
BufferPoolAllocator& operator=(BufferPoolAllocator&& rhs) noexcept = default;
// free all buffers in the pool
~BufferPoolAllocator() noexcept;
// return a buffer of at least size bytes
void* get(size_type size) noexcept;
// return a buffer to the pool
void put(void* buffer) noexcept;
// empty the pool and reset the size to 0
void reset() noexcept;
private:
struct alignas(ALIGNMENT) Header {
size_type size;
};
static constexpr size_t ALLOCATION_ROUNDING = 4096;
void deallocate(Header const* p) noexcept {
--mOutstandingBuffers;
mAllocator.free((void*)p, p->size + sizeof(Header));
}
void clearInternal() noexcept {
for (auto p: mEntries) {
assert_invariant(p->size == mSize);
deallocate(p);
}
mEntries.clear();
}
using Container = utils::FixedCapacityVector<Header*, std::allocator<Header*>, false>;
size_type mSize = 0; // size of our buffers in the pool
size_type mOutstandingBuffers = 0;
Container mEntries = Container::with_capacity(POOL_SIZE);
AllocatorPolicy mAllocator;
LockingPolicy mLock;
};
template<size_t POOL_SIZE, size_t ALIGNMENT, typename AllocatorPolicy, typename LockingPolicy>
BufferPoolAllocator<POOL_SIZE, ALIGNMENT, AllocatorPolicy, LockingPolicy>::~BufferPoolAllocator() noexcept {
assert_invariant(mOutstandingBuffers == mEntries.size());
clearInternal();
}
template<size_t POOL_SIZE, size_t ALIGNMENT, typename AllocatorPolicy, typename LockingPolicy>
void BufferPoolAllocator<POOL_SIZE, ALIGNMENT, AllocatorPolicy, LockingPolicy>::reset() noexcept {
std::lock_guard<LockingPolicy> guard(mLock);
clearInternal();
mSize = 0;
}
template<size_t POOL_SIZE, size_t ALIGNMENT, typename AllocatorPolicy, typename LockingPolicy>
void* BufferPoolAllocator<POOL_SIZE, ALIGNMENT, AllocatorPolicy, LockingPolicy>::get(size_type size) noexcept {
std::lock_guard<LockingPolicy> guard(mLock);
// if the requested size is larger that our buffers in the pool, we just empty the pool
if (UTILS_UNLIKELY(size > mSize)) {
clearInternal(); // free all buffers
// round to 4K allocations to help cutting down on calling malloc.
size_t roundedSize = ((size + sizeof(Header)) + (ALLOCATION_ROUNDING - 1)) & ~(ALLOCATION_ROUNDING - 1);
mSize = roundedSize - sizeof(Header); // record the new buffer size
assert_invariant(mSize >= size);
}
// if the pool is empty, allocate a new buffer of the pool buffer size (which may be
// larger than the requested size).
if (UTILS_UNLIKELY(mEntries.empty())) {
++mOutstandingBuffers;
Header* p = (Header*)mAllocator.alloc(mSize + sizeof(Header), ALIGNMENT);
p->size = mSize;
return p + 1;
}
// if we have an entry in the pool we know it's at least of the requested size
assert_invariant(mSize >= size);
// return the last entry
Header* p = mEntries.back();
mEntries.pop_back();
return p + 1;
}
template<size_t POOL_SIZE, size_t ALIGNMENT, typename AllocatorPolicy, typename LockingPolicy>
void BufferPoolAllocator<POOL_SIZE, ALIGNMENT, AllocatorPolicy, LockingPolicy>::put(void* buffer) noexcept {
std::lock_guard<LockingPolicy> guard(mLock);
// retrieve this buffer's header
Header const* const p = static_cast<Header const*>(buffer) - 1;
// if the returned buffer is smaller than the current pool buffer size, or, the pool
// is full, just free that buffer.
if (UTILS_UNLIKELY(mEntries.size() == mEntries.capacity() || p->size < mSize)) {
deallocate(p);
return;
}
// add this buffer to the pool
assert_invariant(p->size == mSize);
mEntries.push_back(const_cast<Header *>(p));
}
} // namespace filament
#endif // TNT_FILAMENT_BUFFERPOOLALLOCATOR_H
+2 -2
View File
@@ -1118,8 +1118,8 @@ FrameGraphId<FrameGraphTexture> PostProcessManager::gaussianBlurPass(FrameGraph&
commitAndRender(hwTempRT, separableGaussianBlur, driver);
// vertical pass
auto width = outDesc.width;
auto height = outDesc.height;
UTILS_UNUSED_IN_RELEASE auto width = outDesc.width;
UTILS_UNUSED_IN_RELEASE auto height = outDesc.height;
assert_invariant(width == hwOutRT.params.viewport.width);
assert_invariant(height == hwOutRT.params.viewport.height);
+11 -2
View File
@@ -53,6 +53,7 @@ RenderPass::~RenderPass() noexcept = default;
RenderPass::Command* RenderPass::append(size_t count) noexcept {
// this is like a "in-place" realloc(). Works only with LinearAllocator.
Command* const curr = mCommandArena.alloc<Command>(count);
assert_invariant(curr);
assert_invariant(mCommandBegin == nullptr || curr == mCommandEnd);
if (mCommandBegin == nullptr) {
mCommandBegin = mCommandEnd = curr;
@@ -423,16 +424,24 @@ void RenderPass::generateCommandsImpl(uint32_t extraFlags,
const bool blendPass = Pass(cmdColor.key & PASS_MASK) == Pass::BLENDED;
if (blendPass) {
// TODO: at least for transparent objects, AABB should be per primitive
// but that would break the "local" blend-order, which relies on
// all primitives having the same Z
// blend pass:
// this will sort back-to-front for blended, and honor explicit ordering
// for a given Z value
// This will sort back-to-front for blended, and honor explicit ordering
// for a given Z value, or globally.
cmdColor.key &= ~BLEND_ORDER_MASK;
cmdColor.key &= ~BLEND_DISTANCE_MASK;
// write the distance
cmdColor.key |= makeField(~distanceBits,
BLEND_DISTANCE_MASK, BLEND_DISTANCE_SHIFT);
// clear the distance if global ordering is enabled
cmdColor.key &= ~select(primitive.isGlobalBlendOrderEnabled(),
BLEND_DISTANCE_MASK);
// write blend order
cmdColor.key |= makeField(primitive.getBlendOrder(),
BLEND_ORDER_MASK, BLEND_ORDER_SHIFT);
const TransparencyMode mode = mi->getTransparencyMode();
// handle transparent objects, two techniques:
+5
View File
@@ -213,6 +213,11 @@ public:
return boolish ? std::numeric_limits<uint64_t>::max() : uint64_t(0);
}
template<typename T>
static CommandKey select(T boolish, uint64_t value) noexcept {
return boolish ? value : uint64_t(0);
}
struct PrimitiveInfo { // 48 bytes
union {
FMaterialInstance const* mi;
+12 -16
View File
@@ -30,7 +30,6 @@ void FRenderPrimitive::init(backend::DriverApi& driver,
assert_invariant(entry.materialInstance);
mHandle = driver.createRenderPrimitive();
mMaterialInstance = upcast(entry.materialInstance);
mBlendOrder = entry.blendOrder;
@@ -43,10 +42,8 @@ void FRenderPrimitive::init(backend::DriverApi& driver,
auto const& ebh = vertexBuffer->getHwHandle();
auto const& ibh = indexBuffer->getHwHandle();
driver.setRenderPrimitiveBuffer(mHandle, ebh, ibh);
driver.setRenderPrimitiveRange(mHandle, entry.type,
(uint32_t)entry.offset, (uint32_t)entry.minIndex, (uint32_t)entry.maxIndex,
(uint32_t)entry.count);
mHandle = driver.createRenderPrimitive(ebh, ibh, entry.type, (uint32_t)entry.offset,
(uint32_t)entry.minIndex, (uint32_t)entry.maxIndex, (uint32_t)entry.count);
mPrimitiveType = entry.type;
mEnabledAttributes = enabledAttributes;
@@ -55,32 +52,31 @@ void FRenderPrimitive::init(backend::DriverApi& driver,
void FRenderPrimitive::terminate(FEngine& engine) {
FEngine::DriverApi& driver = engine.getDriverApi();
driver.destroyRenderPrimitive(mHandle);
if (mHandle) {
driver.destroyRenderPrimitive(mHandle);
}
}
void FRenderPrimitive::set(FEngine& engine, RenderableManager::PrimitiveType type,
FVertexBuffer* vertices, FIndexBuffer* indices, size_t offset,
size_t minIndex, size_t maxIndex, size_t count) noexcept {
AttributeBitset enabledAttributes = vertices->getDeclaredAttributes();
auto const& ebh = vertices->getHwHandle();
auto const& ibh = indices->getHwHandle();
FEngine::DriverApi& driver = engine.getDriverApi();
driver.setRenderPrimitiveBuffer(mHandle, ebh, ibh);
driver.setRenderPrimitiveRange(mHandle, type,
if (mHandle) {
driver.destroyRenderPrimitive(mHandle);
}
mHandle = driver.createRenderPrimitive(ebh, ibh, type,
(uint32_t)offset, (uint32_t)minIndex, (uint32_t)maxIndex, (uint32_t)count);
mPrimitiveType = type;
mEnabledAttributes = enabledAttributes;
}
void FRenderPrimitive::set(FEngine& engine, RenderableManager::PrimitiveType type, size_t offset,
size_t minIndex, size_t maxIndex, size_t count) noexcept {
FEngine::DriverApi& driver = engine.getDriverApi();
driver.setRenderPrimitiveRange(mHandle, type,
(uint32_t)offset, (uint32_t)minIndex, (uint32_t)maxIndex, (uint32_t)count);
mPrimitiveType = type;
}
} // namespace filament
+11 -6
View File
@@ -42,9 +42,6 @@ public:
FVertexBuffer* vertices, FIndexBuffer* indices, size_t offset,
size_t minIndex, size_t maxIndex, size_t count) noexcept;
void set(FEngine& engine, RenderableManager::PrimitiveType type,
size_t offset, size_t minIndex, size_t maxIndex, size_t count) noexcept;
// frees driver resources, object becomes invalid
void terminate(FEngine& engine);
@@ -53,18 +50,26 @@ public:
backend::PrimitiveType getPrimitiveType() const noexcept { return mPrimitiveType; }
AttributeBitset getEnabledAttributes() const noexcept { return mEnabledAttributes; }
uint16_t getBlendOrder() const noexcept { return mBlendOrder; }
bool isGlobalBlendOrderEnabled() const noexcept { return mGlobalBlendOrderEnabled; }
void setMaterialInstance(FMaterialInstance const* mi) noexcept { mMaterialInstance = mi; }
void setBlendOrder(uint16_t order) noexcept {
mBlendOrder = static_cast<uint16_t>(order & 0x7FFF);
}
void setGlobalBlendOrderEnabled(bool enabled) noexcept {
mGlobalBlendOrderEnabled = enabled;
}
private:
FMaterialInstance const* mMaterialInstance = nullptr;
backend::Handle<backend::HwRenderPrimitive> mHandle;
backend::PrimitiveType mPrimitiveType = backend::PrimitiveType::NONE;
AttributeBitset mEnabledAttributes;
backend::Handle<backend::HwRenderPrimitive> mHandle = {};
AttributeBitset mEnabledAttributes = {};
uint16_t mBlendOrder = 0;
bool mGlobalBlendOrderEnabled = false;
backend::PrimitiveType mPrimitiveType = backend::PrimitiveType::NONE;
UTILS_UNUSED uint8_t reserved[4] = {};
};
} // namespace filament
+5 -5
View File
@@ -102,6 +102,11 @@ void RenderableManager::setBlendOrderAt(Instance instance, size_t primitiveIndex
upcast(this)->setBlendOrderAt(instance, 0, primitiveIndex, order);
}
void RenderableManager::setGlobalBlendOrderEnabledAt(RenderableManager::Instance instance,
size_t primitiveIndex, bool enabled) noexcept {
upcast(this)->setGlobalBlendOrderEnabledAt(instance, 0, primitiveIndex, enabled);
}
AttributeBitset RenderableManager::getEnabledAttributesAt(Instance instance, size_t primitiveIndex) const noexcept {
return upcast(this)->getEnabledAttributesAt(instance, 0, primitiveIndex);
}
@@ -113,11 +118,6 @@ void RenderableManager::setGeometryAt(Instance instance, size_t primitiveIndex,
type, upcast(vertices), upcast(indices), offset, count);
}
void RenderableManager::setGeometryAt(RenderableManager::Instance instance, size_t primitiveIndex,
RenderableManager::PrimitiveType type, size_t offset, size_t count) noexcept {
upcast(this)->setGeometryAt(instance, 0, primitiveIndex, type, offset, count);
}
void RenderableManager::setBones(Instance instance,
RenderableManager::Bone const* transforms, size_t boneCount, size_t offset) {
upcast(this)->setBones(instance, transforms, boneCount, offset);
+1 -1
View File
@@ -95,7 +95,7 @@ public:
* -----------------------------------------------
*/
// Note: we purposedly not include types that require conversion here
// Note: we purposely not include types that require conversion here
// (e.g. bool and bool vectors)
template <typename T>
struct is_supported_type {
+22 -11
View File
@@ -27,6 +27,8 @@
#include "details/Material.h"
#include "private/filament/SibGenerator.h"
#include "filament/RenderableManager.h"
#include <backend/DriverEnums.h>
@@ -210,13 +212,22 @@ RenderableManager::Builder& RenderableManager::Builder::morphing(uint8_t level,
return *this;
}
RenderableManager::Builder& RenderableManager::Builder::blendOrder(size_t index, uint16_t blendOrder) noexcept {
RenderableManager::Builder& RenderableManager::Builder::blendOrder(
size_t index, uint16_t blendOrder) noexcept {
if (index < mImpl->mEntries.size()) {
mImpl->mEntries[index].blendOrder = blendOrder;
}
return *this;
}
RenderableManager::Builder& RenderableManager::Builder::globalBlendOrderEnabled(
size_t index, bool enabled) noexcept {
if (index < mImpl->mEntries.size()) {
mImpl->mEntries[index].globalBlendOrderEnabled = enabled;
}
return *this;
}
RenderableManager::Builder::Result RenderableManager::Builder::build(Engine& engine, Entity entity) {
bool isEmpty = true;
@@ -535,6 +546,16 @@ void FRenderableManager::setBlendOrderAt(Instance instance, uint8_t level,
}
}
void FRenderableManager::setGlobalBlendOrderEnabledAt(Instance instance, uint8_t level,
size_t primitiveIndex, bool enabled) noexcept {
if (instance) {
Slice<FRenderPrimitive>& primitives = getRenderPrimitives(instance, level);
if (primitiveIndex < primitives.size()) {
primitives[primitiveIndex].setGlobalBlendOrderEnabled(enabled);
}
}
}
AttributeBitset FRenderableManager::getEnabledAttributesAt(
Instance instance, uint8_t level, size_t primitiveIndex) const noexcept {
if (instance) {
@@ -558,16 +579,6 @@ void FRenderableManager::setGeometryAt(Instance instance, uint8_t level, size_t
}
}
void FRenderableManager::setGeometryAt(Instance instance, uint8_t level, size_t primitiveIndex,
PrimitiveType type, size_t offset, size_t count) noexcept {
if (instance) {
Slice<FRenderPrimitive>& primitives = getRenderPrimitives(instance, level);
if (primitiveIndex < primitives.size()) {
primitives[primitiveIndex].set(mEngine, type, offset, 0, 0, count);
}
}
}
void FRenderableManager::setBones(Instance ci,
Bone const* UTILS_RESTRICT transforms, size_t boneCount, size_t offset) {
if (ci) {
+1 -2
View File
@@ -165,9 +165,8 @@ public:
void setGeometryAt(Instance instance, uint8_t level, size_t primitiveIndex,
PrimitiveType type, FVertexBuffer* vertices, FIndexBuffer* indices,
size_t offset, size_t count) noexcept;
void setGeometryAt(Instance instance, uint8_t level, size_t primitiveIndex,
PrimitiveType type, size_t offset, size_t count) noexcept;
void setBlendOrderAt(Instance instance, uint8_t level, size_t primitiveIndex, uint16_t blendOrder) noexcept;
void setGlobalBlendOrderEnabledAt(Instance instance, uint8_t level, size_t primitiveIndex, bool enabled) noexcept;
AttributeBitset getEnabledAttributesAt(Instance instance, uint8_t level, size_t primitiveIndex) const noexcept;
inline utils::Slice<FRenderPrimitive> const& getRenderPrimitives(Instance instance, uint8_t level) const noexcept;
inline utils::Slice<FRenderPrimitive>& getRenderPrimitives(Instance instance, uint8_t level) noexcept;
+3 -5
View File
@@ -233,11 +233,9 @@ void FEngine::init() {
mFullScreenTriangleIb->setBuffer(*this,
{ sFullScreenTriangleIndices, sizeof(sFullScreenTriangleIndices) });
mFullScreenTriangleRph = driverApi.createRenderPrimitive();
driverApi.setRenderPrimitiveBuffer(mFullScreenTriangleRph,
mFullScreenTriangleVb->getHwHandle(), mFullScreenTriangleIb->getHwHandle());
driverApi.setRenderPrimitiveRange(mFullScreenTriangleRph, PrimitiveType::TRIANGLES,
0, 0, 2, (uint32_t)mFullScreenTriangleIb->getIndexCount());
mFullScreenTriangleRph = driverApi.createRenderPrimitive(
mFullScreenTriangleVb->getHwHandle(), mFullScreenTriangleIb->getHwHandle(),
PrimitiveType::TRIANGLES, 0, 0, 2, (uint32_t)mFullScreenTriangleIb->getIndexCount());
// Compute a clip-space [-1 to 1] to texture space [0 to 1] matrix, taking into account
// backend differences.
+2 -2
View File
@@ -107,8 +107,8 @@ class ResourceAllocator;
class FEngine : public Engine {
public:
inline void* operator new(std::size_t count) noexcept {
return utils::aligned_alloc(count * sizeof(FEngine), alignof(FEngine));
inline void* operator new(std::size_t size) noexcept {
return utils::aligned_alloc(size, alignof(FEngine));
}
inline void operator delete(void* p) noexcept {
+73 -52
View File
@@ -25,6 +25,8 @@
#include "details/IndirectLight.h"
#include "details/Skybox.h"
#include "BufferPoolAllocator.h"
#include <utils/compiler.h>
#include <utils/EntityManager.h>
#include <utils/Range.h>
@@ -147,6 +149,7 @@ void FScene::prepare(const mat4& worldOriginTransform, bool shadowReceiversAreCa
worldAABB.halfExtent, // WORLD_AABB_EXTENT
{}, // PRIMITIVES
0, // SUMMED_PRIMITIVE_COUNT
{}, // UBO
scale // USER_DATA
);
}
@@ -197,28 +200,17 @@ void FScene::prepare(const mat4& worldOriginTransform, bool shadowReceiversAreCa
}
}
void FScene::updateUBOs(
Range<uint32_t> visibleRenderables,
Handle<HwBufferObject> renderableUbh) noexcept {
FEngine::DriverApi& driver = mEngine.getDriverApi();
void FScene::prepareVisibleRenderables(Range<uint32_t> visibleRenderables) noexcept {
RenderableSoa& sceneData = mRenderableData;
FRenderableManager& rcm = mEngine.getRenderableManager();
const size_t size = visibleRenderables.size() * sizeof(PerRenderableUib);
// allocate space into the command stream directly
void* const buffer = driver.allocatePod<PerRenderableUib>(visibleRenderables.size());
bool hasContactShadows = false;
auto& sceneData = mRenderableData;
mHasContactShadows = false;
for (uint32_t i : visibleRenderables) {
mat4f const& model = sceneData.elementAt<WORLD_TRANSFORM>(i);
FRenderableManager::Visibility visibility = sceneData.elementAt<VISIBILITY_STATE>(i);
auto ri = sceneData.elementAt<RENDERABLE_INSTANCE>(i);
PerRenderableData& uboData = sceneData.elementAt<UBO>(i);
const size_t offset = i * sizeof(PerRenderableUib);
UniformBuffer::setUniform(buffer,
offset + offsetof(PerRenderableUib, worldFromModelMatrix), model);
auto const visibility = sceneData.elementAt<VISIBILITY_STATE>(i);
auto const& model = sceneData.elementAt<WORLD_TRANSFORM>(i);
auto const ri = sceneData.elementAt<RENDERABLE_INSTANCE>(i);
// Using mat3f::getTransformForNormals handles non-uniform scaling, but DOESN'T guarantee that
// the transformed normals will have unit-length, therefore they need to be normalized
@@ -241,41 +233,66 @@ void FScene::updateUBOs(
m = -m;
}
UniformBuffer::setUniform(buffer,
offset + offsetof(PerRenderableUib, worldFromModelNormalMatrix), m);
uboData.worldFromModelMatrix = model;
// Note that we cast bool to uint32_t. Booleans are byte-sized in C++, but we need to
// initialize all 32 bits in the UBO field.
uboData.worldFromModelNormalMatrix = m;
hasContactShadows = hasContactShadows || visibility.screenSpaceContactShadows;
uboData.flagsChannels = PerRenderableData::packFlagsChannels(
visibility.skinning,
visibility.morphing,
visibility.screenSpaceContactShadows,
sceneData.elementAt<CHANNELS>(i));
UniformBuffer::setUniform(buffer,
offset + offsetof(PerRenderableUib, flagsChannels),
PerRenderableUib::packFlagsChannels(
visibility.skinning,
visibility.morphing,
visibility.screenSpaceContactShadows,
sceneData.elementAt<CHANNELS>(i)));
uboData.morphTargetCount = sceneData.elementAt<MORPHING_BUFFER>(i).count;
UniformBuffer::setUniform(buffer,
offset + offsetof(PerRenderableUib, morphTargetCount),
sceneData.elementAt<MORPHING_BUFFER>(i).count);
UniformBuffer::setUniform(buffer,
offset + offsetof(PerRenderableUib, objectId),
rcm.getEntity(ri).getId()); // we could also store the entity in sceneData
uboData.objectId = rcm.getEntity(ri).getId();
// TODO: We need to find a better way to provide the scale information per object
UniformBuffer::setUniform(buffer,
offset + offsetof(PerRenderableUib, userData),
sceneData.elementAt<USER_DATA>(i));
uboData.userData = sceneData.elementAt<USER_DATA>(i);
mHasContactShadows = mHasContactShadows || visibility.screenSpaceContactShadows;
}
}
void FScene::updateUBOs(
Range<uint32_t> visibleRenderables,
Handle<HwBufferObject> renderableUbh) noexcept {
FEngine::DriverApi& driver = mEngine.getDriverApi();
// store the UBO handle
mRenderableViewUbh = renderableUbh;
// don't allocate more than 16 KiB directly into the render stream
static constexpr size_t MAX_STREAM_ALLOCATION_COUNT = 64; // 16 KiB
const size_t count = visibleRenderables.size();
PerRenderableUib* buffer = [&]{
if (count >= MAX_STREAM_ALLOCATION_COUNT) {
// use the heap allocator
return (PerRenderableUib*)mBufferPoolAllocator.get(count * sizeof(PerRenderableUib));
} else {
// allocate space into the command stream directly
return driver.allocatePod<PerRenderableUib>(count);
}
}();
// copy our data into the UBO for each visible renderable
PerRenderableData const* const uboData = mRenderableData.data<UBO>();
for (uint32_t i : visibleRenderables) {
buffer[i].data = uboData[i];
}
// TODO: handle static objects separately
mHasContactShadows = hasContactShadows;
mRenderableViewUbh = renderableUbh;
driver.updateBufferObject(renderableUbh, { buffer, size }, 0);
// update the UBO
driver.updateBufferObject(renderableUbh, {
buffer, count * sizeof(PerRenderableUib),
+[](void* p, size_t s, void* user) {
if (s >= MAX_STREAM_ALLOCATION_COUNT * sizeof(PerRenderableUib)) {
FScene* const that = static_cast<FScene*>(user);
that->mBufferPoolAllocator.put(p);
}
}, this
}, 0);
// update skybox
if (mSkybox) {
mSkybox->commit(driver);
}
@@ -430,23 +447,27 @@ void FScene::setSkybox(FSkybox* skybox) noexcept {
}
bool FScene::hasContactShadows() const noexcept {
// at least some renderables in the scene must have contact-shadows enabled
// TODO: we should refine this with only the visible ones
if (!mHasContactShadows) {
return false;
}
// find out if at least one light has contact-shadow enabled
// TODO: cache the the result of this Loop in the LightManager
bool hasContactShadows = false;
// TODO: we could cache the the result of this Loop in the LightManager
auto& lcm = mEngine.getLightManager();
const auto *pFirst = mLightData.begin<LIGHT_INSTANCE>();
const auto *pLast = mLightData.end<LIGHT_INSTANCE>();
while (pFirst != pLast && !hasContactShadows) {
while (pFirst != pLast) {
if (pFirst->isValid()) {
auto const& shadowOptions = lcm.getShadowOptions(*pFirst);
hasContactShadows = shadowOptions.screenSpaceContactShadows;
if (shadowOptions.screenSpaceContactShadows) {
return true;
}
}
++pFirst;
}
// at least some renderables in the scene must have contact-shadows enabled
// TODO: we should refine this with only the visible ones
return hasContactShadows && mHasContactShadows;
return false;
}
UTILS_NOINLINE
+22 -14
View File
@@ -26,6 +26,8 @@
#include "components/RenderableManager.h"
#include "components/TransformManager.h"
#include "BufferPoolAllocator.h"
#include <filament/Box.h>
#include <filament/Scene.h>
@@ -68,6 +70,9 @@ public:
void terminate(FEngine& engine);
void prepare(const math::mat4& worldOriginTransform, bool shadowReceiversAreCasters) noexcept;
void prepareVisibleRenderables(utils::Range<uint32_t> visibleRenderables) noexcept;
void prepareDynamicLights(const CameraInfo& camera, ArenaScope& arena,
backend::Handle<backend::HwBufferObject> lightUbh) noexcept;
@@ -82,26 +87,27 @@ public:
using VisibleMaskType = Culler::result_type;
enum {
RENDERABLE_INSTANCE, // 4 | instance of the Renderable component
WORLD_TRANSFORM, // 16 | instance of the Transform component
VISIBILITY_STATE, // 2 | visibility data of the component
SKINNING_BUFFER, // 8 | bones uniform buffer handle, offset
MORPHING_BUFFER, // 16 | weights uniform buffer handle, count, morph targets
WORLD_AABB_CENTER, // 12 | world-space bounding box center of the renderable
VISIBLE_MASK, // 2 | each bit represents a visibility in a pass
CHANNELS, // 1 | currently light channels only
INSTANCE_COUNT, // 2 | draw instance count
RENDERABLE_INSTANCE, // 4 | instance of the Renderable component
WORLD_TRANSFORM, // 16 | instance of the Transform component
VISIBILITY_STATE, // 2 | visibility data of the component
SKINNING_BUFFER, // 8 | bones uniform buffer handle, offset
MORPHING_BUFFER, // 16 | weights uniform buffer handle, count, morph targets
WORLD_AABB_CENTER, // 12 | world-space bounding box center of the renderable
VISIBLE_MASK, // 2 | each bit represents a visibility in a pass
CHANNELS, // 1 | currently light channels only
INSTANCE_COUNT, // 2 | draw instance count
// These are not needed anymore after culling
LAYERS, // 1 | layers
WORLD_AABB_EXTENT, // 12 | world-space bounding box half-extent of the renderable
LAYERS, // 1 | layers
WORLD_AABB_EXTENT, // 12 | world-space bounding box half-extent of the renderable
// These are temporaries and should be stored out of line
PRIMITIVES, // 8 | level-of-detail'ed primitives
SUMMED_PRIMITIVE_COUNT, // 4 | summed visible primitive counts
PRIMITIVES, // 8 | level-of-detail'ed primitives
SUMMED_PRIMITIVE_COUNT, // 4 | summed visible primitive counts
UBO, // 128 |
// FIXME: We need a better way to handle this
USER_DATA, // 4 | user data currently used to store the scale
USER_DATA, // 4 | user data currently used to store the scale
};
using RenderableSoa = utils::StructureOfArrays<
@@ -118,6 +124,7 @@ public:
math::float3, // WORLD_AABB_EXTENT
utils::Slice<FRenderPrimitive>, // PRIMITIVES
uint32_t, // SUMMED_PRIMITIVE_COUNT
PerRenderableData, // UBO
// FIXME: We need a better way to handle this
float // USER_DATA
>;
@@ -214,6 +221,7 @@ private:
LightSoa mLightData;
backend::Handle<backend::HwBufferObject> mRenderableViewUbh; // This is actually owned by the view.
bool mHasContactShadows = false;
BufferPoolAllocator<3> mBufferPoolAllocator;
};
FILAMENT_UPCAST(Scene)
+2
View File
@@ -547,6 +547,8 @@ void FView::prepare(FEngine& engine, DriverApi& driver, ArenaScope& arena,
mSpotLightShadowCasters = Range{ 0, iSpotLightCastersEnd };
merged = Range{ 0, iSpotLightCastersEnd };
scene->prepareVisibleRenderables(merged);
// update those UBOs
const size_t size = merged.size() * sizeof(PerRenderableUib);
if (size) {
+2 -2
View File
@@ -1,12 +1,12 @@
Pod::Spec.new do |spec|
spec.name = "Filament"
spec.version = "1.23.0"
spec.version = "1.23.1"
spec.license = { :type => "Apache 2.0", :file => "LICENSE" }
spec.homepage = "https://google.github.io/filament"
spec.authors = "Google LLC."
spec.summary = "Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS, and WASM/WebGL."
spec.platform = :ios, "11.0"
spec.source = { :http => "https://github.com/google/filament/releases/download/v1.23.0/filament-v1.23.0-ios.tgz" }
spec.source = { :http => "https://github.com/google/filament/releases/download/v1.23.1/filament-v1.23.1-ios.tgz" }
# Fix linking error with Xcode 12; we do not yet support the simulator on Apple silicon.
spec.pod_target_xcconfig = {
@@ -123,7 +123,7 @@
};
};
buildConfigurationList = 90327DE42AE5DF12C4BD2113 /* Build configuration list for PBXProject "gltf-viewer" */;
compatibilityVersion = "Xcode 11.0";
compatibilityVersion = "Xcode 10.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
@@ -426,6 +426,7 @@
"-lgeometry",
"-lstb",
"-lbasis_transcoder",
"-lzstd",
"-lcamutils",
"-ldracodec",
"-lviewer",
@@ -480,6 +481,7 @@
"-lgeometry",
"-lstb",
"-lbasis_transcoder",
"-lzstd",
"-lcamutils",
"-ldracodec",
"-lviewer",
@@ -596,6 +598,7 @@
"-lgeometry",
"-lstb",
"-lbasis_transcoder",
"-lzstd",
"-lcamutils",
"-ldracodec",
"-lviewer",
@@ -650,6 +653,7 @@
"-lgeometry",
"-lstb",
"-lbasis_transcoder",
"-lzstd",
"-lcamutils",
"-ldracodec",
"-lviewer",
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1200"
version = "1.7">
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1200"
version = "1.7">
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
+1 -1
View File
@@ -20,7 +20,7 @@ targets:
settings:
base:
OTHER_LDFLAGS: ["-lgltfio_core", "-lgltfio_resources", "-limage", "-lgeometry", "-lstb", "-lbasis_transcoder",
"-lcamutils", "-ldracodec", "-lviewer", "-lcivetweb", "-lktxreader"]
"-lzstd", "-lcamutils", "-ldracodec", "-lviewer", "-lcivetweb", "-lktxreader"]
preBuildScripts:
- path: build-resources.sh
name: Build Resources
+2 -3
View File
@@ -36,13 +36,12 @@ bool loadLibrary() {
#ifndef FILAMENT_VKLIBRARY_PATH
// Rather than looking in the working directory, look for the dylib in the same folder that the
// executable lives in. This allows MacOS users to run Vulkan-based Filament apps from anywhere.
const Path executableFolder = Path::getCurrentExecutable().getParent();
const Path dylibPath = executableFolder.concat(VKLIBRARY_PATH);
const Path dylibPath = VKLIBRARY_PATH;
// Provide a value for VK_ICD_FILENAMES only if it has not already been set.
const char* icd = getenv("VK_ICD_FILENAMES");
if (icd == nullptr) {
const Path jsonPath = executableFolder.concat("MoltenVK_icd.json");
const Path jsonPath = "/usr/local/share/vulkan/icd.d/MoltenVK_icd.json";
setenv("VK_ICD_FILENAMES", jsonPath.c_str(), 1);
}
#else
@@ -171,17 +171,30 @@ struct PerViewUib { // NOLINT(cppcoreguidelines-pro-type-member-init)
static_assert(sizeof(PerViewUib) == sizeof(math::float4) * 128,
"PerViewUib should be exactly 2KiB");
// PerRenderableUib must have an alignment of 256 to be compatible with all versions of GLES.
struct alignas(256) PerRenderableUib { // NOLINT(cppcoreguidelines-pro-type-member-init)
static constexpr utils::StaticString _name{ "ObjectUniforms" };
// ------------------------------------------------------------------------------------------------
// MARK: -
struct PerRenderableData {
struct alignas(16) vec3_std140 : public std::array<float, 3> { };
struct mat33_std140 : public std::array<vec3_std140, 3> {
mat33_std140& operator=(math::mat3f const& rhs) noexcept {
for (int i = 0; i < 3; i++) {
(*this)[i][0] = rhs[i][0];
(*this)[i][1] = rhs[i][1];
(*this)[i][2] = rhs[i][2];
}
return *this;
}
};
math::mat4f worldFromModelMatrix;
math::mat3f worldFromModelNormalMatrix; // this gets expanded to 48 bytes during the copy to the UBO
alignas(16) uint32_t morphTargetCount;
mat33_std140 worldFromModelNormalMatrix;
uint32_t morphTargetCount;
uint32_t flagsChannels; // see packFlags() below (0x00000fll)
uint32_t objectId; // used for picking
// TODO: We need a better solution, this currently holds the average local scale for the renderable
float userData;
math::float4 reserved[8];
static uint32_t packFlagsChannels(
bool skinning, bool morphing, bool contactShadows, uint8_t channels) noexcept {
@@ -191,8 +204,20 @@ struct alignas(256) PerRenderableUib { // NOLINT(cppcoreguidelines-pro-type-memb
channels;
}
};
static_assert(sizeof(PerRenderableData) == 128,
"sizeof(PerRenderableData) must be 128 bytes");
static_assert(sizeof(PerRenderableUib) == 256, "sizeof(PerRenderableUib) must be 256 bytes");
struct alignas(256) PerRenderableUib { // NOLINT(cppcoreguidelines-pro-type-member-init)
static constexpr utils::StaticString _name{ "ObjectUniforms" };
PerRenderableData data;
math::float4 reserved[8];
};
// PerRenderableUib must have an alignment of 256 to be compatible with all versions of GLES.
static_assert(sizeof(PerRenderableUib) == 256,
"sizeof(PerRenderableUib) must be 256 bytes");
// ------------------------------------------------------------------------------------------------
// MARK: -
struct LightsUib { // NOLINT(cppcoreguidelines-pro-type-member-init)
static constexpr utils::StaticString _name{ "LightsUniforms" };
@@ -213,7 +238,11 @@ struct LightsUib { // NOLINT(cppcoreguidelines-pro-type-member-init)
return lightChannels | (castShadows ? 0x10000 : 0);
}
};
static_assert(sizeof(LightsUib) == 64, "the actual UBO is an array of 256 mat4");
static_assert(sizeof(LightsUib) == 64,
"the actual UBO is an array of 256 mat4");
// ------------------------------------------------------------------------------------------------
// MARK: -
// UBO for punctual (spot light) shadows.
struct ShadowUib { // NOLINT(cppcoreguidelines-pro-type-member-init)
@@ -230,14 +259,22 @@ struct ShadowUib { // NOLINT(cppcoreguidelines-pro-type-member-init)
};
ShadowData shadows[CONFIG_MAX_SHADOW_CASTING_SPOTS];
};
static_assert(sizeof(ShadowUib) <= 16384, "ShadowUib exceed max UBO size");
static_assert(sizeof(ShadowUib) <= 16384,
"ShadowUib exceed max UBO size");
// ------------------------------------------------------------------------------------------------
// MARK: -
// UBO froxel record buffer.
struct FroxelRecordUib { // NOLINT(cppcoreguidelines-pro-type-member-init)
static constexpr utils::StaticString _name{ "FroxelRecordUniforms" };
math::uint4 records[1024];
};
static_assert(sizeof(FroxelRecordUib) == 16384, "FroxelRecordUib should be exactly 16KiB");
static_assert(sizeof(FroxelRecordUib) == 16384,
"FroxelRecordUib should be exactly 16KiB");
// ------------------------------------------------------------------------------------------------
// MARK: -
// This is not the UBO proper, but just an element of a bone array.
struct PerRenderableUibBone { // NOLINT(cppcoreguidelines-pro-type-member-init)
@@ -253,6 +290,9 @@ struct PerRenderableUibBone { // NOLINT(cppcoreguidelines-pro-type-member-init)
static_assert(CONFIG_MAX_BONE_COUNT * sizeof(PerRenderableUibBone) <= 16384,
"PerRenderableUibBone exceed max UBO size");
// ------------------------------------------------------------------------------------------------
// MARK: -
struct alignas(16) PerRenderableMorphingUib {
static constexpr utils::StaticString _name{ "MorphingUniforms" };
// The array stride(the bytes between array elements) is always rounded up to the size of a vec4 in std140.
@@ -238,6 +238,21 @@ public:
*/
const Entity* getJointsAt(size_t skinIndex) const noexcept;
/**
* Attaches the given skin to the given node, which must have an associated mesh with
* BONE_INDICES and BONE_WEIGHTS attributes.
*
* This is a no-op if the given skin index or target is invalid.
*/
void attachSkin(size_t skinIndex, Entity target) noexcept;
/**
* Detaches the given skin from the given node.
*
* This is a no-op if the given skin index or target is invalid.
*/
void detachSkin(size_t skinIndex, Entity target) noexcept;
/**
* Gets the morph target name at the given index in the given entity.
*/
+2 -2
View File
@@ -54,8 +54,8 @@ struct ResourceConfiguration {
//! do not need this, but it is useful for robustness.
bool recomputeBoundingBoxes;
//! If true, ignore skinned primitives bind transform when compute bounding box. Implicitly true
//! for instanced asset. Only applicable when recomputeBoundingBoxes is set to true
//! If true, ignores skinning when computing bounding boxes. Implicitly true for instanced
//! assets. Only applicable when recomputeBoundingBoxes is set to true.
bool ignoreBindTransform;
};
+1 -1
View File
@@ -2,7 +2,7 @@ material {
name : sheen_${SHADINGMODEL}_${BLENDING},
requires : [ uv0, uv1, color ],
shadingModel : ${SHADINGMODEL},
blending : fade,
blending : opaque,
depthWrite : true,
doubleSided : ${DOUBLESIDED},
transparency : ${TRANSPARENCY},
+2 -2
View File
@@ -330,10 +330,10 @@ void Animator::updateBoneMatrices() {
auto transformManager = mImpl->transformManager;
auto update = [=](const SkinVector& skins, BoneVector& boneVector) {
for (const auto& skin : skins) {
for (const Skin& skin : skins) {
size_t njoints = skin.joints.size();
boneVector.resize(njoints);
for (const auto& entity : skin.targets) {
for (Entity entity : skin.targets) {
auto renderable = renderableManager->getInstance(entity);
if (!renderable) {
continue;
+10
View File
@@ -319,6 +319,16 @@ void FAssetLoader::createAsset(const cgltf_data* srcAsset, size_t numInstances)
}
}
// Some exporters (e.g. Cinema4D) produce assets with a separate animation hierarchy and
// modeling hierarchy, where nodes in the former have no associated scene. We need to create
// transformable entities for "un-scened" nodes in case they have bones.
for (size_t i = 0, n = srcAsset->nodes_count; i < n; ++i) {
cgltf_node* node = &srcAsset->nodes[i];
if (node->parent == nullptr && mRootNodes.find(node) == mRootNodes.end()) {
mRootNodes.insert({node, {}});
}
}
mResult->mRenderableCount = 0;
if (numInstances == 0) {
+4
View File
@@ -212,6 +212,10 @@ struct FFilamentAsset : public FilamentAsset {
const utils::Entity* getJointsAt(size_t skinIndex) const noexcept;
void attachSkin(size_t skinIndex, Entity target) noexcept;
void detachSkin(size_t skinIndex, Entity target) noexcept;
const char* getMorphTargetNameAt(utils::Entity entity, size_t targetIndex) const noexcept;
size_t getMorphTargetCountAt(utils::Entity entity) const noexcept;
+12 -3
View File
@@ -26,6 +26,7 @@
#include <math/mat4.h>
#include <tsl/robin_map.h>
#include <tsl/robin_set.h>
#include <vector>
@@ -44,9 +45,17 @@ class Animator;
struct Skin {
utils::CString name;
std::vector<filament::math::mat4f> inverseBindMatrices;
std::vector<utils::Entity> joints;
std::vector<utils::Entity> targets;
// The inverse bind matrices and joints arrays must have the same count. Each element
// corresponds to a single bone. We considered using the ECS to store these, but this would be
// complicated because a single node might be used as a bone in more than one skin, and its
// inverse bind matrix might be unique in each of these skins.
utils::FixedCapacityVector<filament::math::mat4f> inverseBindMatrices;
utils::FixedCapacityVector<utils::Entity> joints;
// The set of all nodes that are influenced by this skin.
// This is initially gleaned from the glTF file using the "skin" attribute of each node.
tsl::robin_set<utils::Entity> targets;
};
struct VariantMapping {
+22
View File
@@ -120,6 +120,20 @@ const utils::Entity* FFilamentAsset::getJointsAt(size_t skinIndex) const noexcep
return mSkins[skinIndex].joints.data();
}
void FFilamentAsset::attachSkin(size_t skinIndex, Entity target) noexcept {
if (UTILS_UNLIKELY(mSkins.size() <= skinIndex || target.isNull())) {
return;
}
mSkins[skinIndex].targets.insert(target);
}
void FFilamentAsset::detachSkin(size_t skinIndex, Entity target) noexcept {
if (UTILS_UNLIKELY(mSkins.size() <= skinIndex || target.isNull())) {
return;
}
mSkins[skinIndex].targets.erase(target);
}
const char* FFilamentAsset::getMorphTargetNameAt(utils::Entity entity,
size_t targetIndex) const noexcept {
if (!mResourcesLoaded) {
@@ -381,6 +395,14 @@ const utils::Entity* FilamentAsset::getJointsAt(size_t skinIndex) const noexcept
return upcast(this)->getJointsAt(skinIndex);
}
void FilamentAsset::attachSkin(size_t skinIndex, Entity target) noexcept {
upcast(this)->attachSkin(skinIndex, target);
}
void FilamentAsset::detachSkin(size_t skinIndex, Entity target) noexcept {
upcast(this)->detachSkin(skinIndex, target);
}
const char* FilamentAsset::getMorphTargetNameAt(utils::Entity entity,
size_t targetIndex) const noexcept {
return upcast(this)->getMorphTargetNameAt(entity, targetIndex);
+82 -90
View File
@@ -85,10 +85,6 @@ struct ResourceLoader::Impl {
bool mIgnoreBindTransform;
std::string mGltfPath;
// This is used to calculate skinIndex when updateBoundingBoxes, so that the mapping between
// cgltf_node* and FFilamentInstance::Skin can be retrieved. This pointer doesn't need to be freed.
cgltf_skin* mSkinBaseAddress;
// User-provided resource data with URI string keys, populated with addResourceData().
// This is used on platforms without traditional file systems, such as Android, iOS, and WebGL.
UriDataCache mUriDataCache;
@@ -134,7 +130,7 @@ void importSkins(const cgltf_data* gltf, const NodeMap& nodeMap, SkinVector& dst
if (node.skin) {
int skinIndex = node.skin - &gltf->skins[0];
Entity entity = nodeMap.at(&node);
dstSkins[skinIndex].targets.push_back(entity);
dstSkins[skinIndex].targets.insert(entity);
}
}
for (cgltf_size i = 0, len = gltf->skins_count; i < len; ++i) {
@@ -145,23 +141,16 @@ void importSkins(const cgltf_data* gltf, const NodeMap& nodeMap, SkinVector& dst
}
// Build a list of transformables for this skin, one for each joint.
// TODO: We've seen models with joint nodes that do not belong to the scene's node graph.
// e.g. BrainStem after Draco compression. That's why we have a fallback here. AssetManager
// should maybe create an Entity for every glTF node, period. (regardless of hierarchy)
// https://github.com/CesiumGS/gltf-pipeline/issues/532
dstSkin.joints.resize(srcSkin.joints_count);
dstSkin.joints = FixedCapacityVector<Entity>(srcSkin.joints_count);
for (cgltf_size i = 0, len = srcSkin.joints_count; i < len; ++i) {
auto iter = nodeMap.find(srcSkin.joints[i]);
if (iter == nodeMap.end()) {
dstSkin.joints[i] = nodeMap.begin()->second;
} else {
dstSkin.joints[i] = iter->second;
}
assert_invariant(iter != nodeMap.end());
dstSkin.joints[i] = iter->second;
}
// Retain a copy of the inverse bind matrices because the source blob could be evicted later.
const cgltf_accessor* srcMatrices = srcSkin.inverse_bind_matrices;
dstSkin.inverseBindMatrices.resize(srcSkin.joints_count);
dstSkin.inverseBindMatrices = FixedCapacityVector<mat4f>(srcSkin.joints_count);
if (srcMatrices) {
auto dstMatrices = (uint8_t*) dstSkin.inverseBindMatrices.data();
uint8_t* bytes = (uint8_t*) srcMatrices->buffer_view->buffer->data;
@@ -458,7 +447,6 @@ bool ResourceLoader::loadResources(FFilamentAsset* asset, bool async) {
if (!pImpl->mIgnoreBindTransform) {
pImpl->mIgnoreBindTransform = asset->isInstanced();
}
pImpl->mSkinBaseAddress = &gltf->skins[0];
updateBoundingBoxes(asset);
}
@@ -902,101 +890,105 @@ void ResourceLoader::updateBoundingBoxes(FFilamentAsset* asset) const {
*result = aabb;
};
const size_t posAttrSize = cgltf_num_components(cgltf_type_vec3);
const size_t skinningAttrSize = cgltf_num_components(cgltf_type_vec4);
auto computeBoundingBoxSkinned = [&](const cgltf_primitive* prim, const Skin* skin, Aabb* result) {
Aabb aabb;
std::vector<mat4f> inverseGlobalTransforms(skin->targets.size());
for (size_t i = 0; i < skin->targets.size(); i++) {
auto xformable = tm.getInstance(skin->targets[i]);
if (xformable) {
inverseGlobalTransforms[i] = inverse(tm.getWorldTransform(xformable));
}
}
std::vector<float> verts;
std::vector<float> rawJoints;
std::vector<float> weights;
for (cgltf_size slot = 0; slot < prim->attributes_count; slot++) {
const cgltf_attribute& attr = prim->attributes[slot];
const cgltf_accessor* accessor = attr.data;
if (attr.type == cgltf_attribute_type_position &&
cgltf_num_components(accessor->type) >= posAttrSize) {
verts.resize(accessor->count * posAttrSize);
cgltf_accessor_unpack_floats(accessor, &verts[0], accessor->count * posAttrSize);
}
if (attr.type == cgltf_attribute_type_joints &&
cgltf_num_components(accessor->type) >= skinningAttrSize) {
rawJoints.resize(accessor->count * skinningAttrSize);
cgltf_accessor_unpack_floats(accessor, &rawJoints[0], accessor->count * skinningAttrSize);
}
if (attr.type == cgltf_attribute_type_weights &&
cgltf_num_components(accessor->type) >= skinningAttrSize) {
weights.resize(accessor->count * skinningAttrSize);
cgltf_accessor_unpack_floats(accessor, &weights[0], accessor->count * skinningAttrSize);
}
}
std::vector<size_t> jointIndices(rawJoints.begin(), rawJoints.end());
auto primitiveCount = static_cast<size_t>(verts.size() / posAttrSize);
for (size_t i = 0; i < primitiveCount; i++) {
float3 point(verts[posAttrSize * i], verts[posAttrSize * i + 1], verts[posAttrSize * i + 2]);
mat4f tmp = mat4f(0.0f);
for (size_t j = 0; j < skinningAttrSize; j++) {
size_t jointIndex = jointIndices[skinningAttrSize * i + j];
float jointWeight = weights[skinningAttrSize * i + j];
Entity jointEntity = skin->joints[jointIndex];
mat4f globalJointTransform = tm.getWorldTransform(tm.getInstance(jointEntity));
mat4f inverseBindMatrix = skin->inverseBindMatrices[jointIndex];
tmp += jointWeight * globalJointTransform * inverseBindMatrix;
}
for (const auto& inverseGlobalTransform: inverseGlobalTransforms) {
mat4f skinMatrix = inverseGlobalTransform * tmp;
if (!pImpl->mNormalizeSkinningWeights) {
skinMatrix /= skinMatrix[3].w;
struct Prim {
cgltf_primitive const* prim;
Skin const* skin;
Entity node;
};
auto computeBoundingBoxSkinned = [&](const Prim& prim, Aabb* result) {
FixedCapacityVector<float3> verts;
FixedCapacityVector<uint4> joints;
FixedCapacityVector<float4> weights;
for (cgltf_size slot = 0, n = prim.prim->attributes_count; slot < n; ++slot) {
const cgltf_attribute& attr = prim.prim->attributes[slot];
const cgltf_accessor& accessor = *attr.data;
switch (attr.type) {
case cgltf_attribute_type_position:
verts = FixedCapacityVector<float3>(accessor.count);
cgltf_accessor_unpack_floats(&accessor, &verts.data()->x, accessor.count * 3);
break;
case cgltf_attribute_type_joints: {
FixedCapacityVector<float4> tmp(accessor.count);
cgltf_accessor_unpack_floats(&accessor, &tmp.data()->x, accessor.count * 4);
joints = FixedCapacityVector<uint4>(accessor.count);
for (size_t i = 0, n = accessor.count; i < n; ++i) {
joints[i] = uint4(tmp[i]);
}
float3 skinnedPoint = (point.x * skinMatrix[0] +
point.y * skinMatrix[1] + point.z * skinMatrix[2] + skinMatrix[3]).xyz;
aabb.min = min(aabb.min, skinnedPoint);
aabb.max = max(aabb.max, skinnedPoint);
break;
}
case cgltf_attribute_type_weights:
weights = FixedCapacityVector<float4>(accessor.count);
cgltf_accessor_unpack_floats(&accessor, &weights.data()->x, accessor.count * 4);
break;
default:
break;
}
}
Aabb aabb;
TransformManager::Instance transformable = tm.getInstance(prim.node);
const mat4f inverseGlobalTransform = inverse(tm.getWorldTransform(transformable));
for (size_t i = 0, n = verts.size(); i < n; i++) {
float3 point = verts[i];
mat4f tmp = mat4f(0.0f);
for (size_t j = 0; j < 4; j++) {
size_t jointIndex = joints[i][j];
Entity jointEntity = prim.skin->joints[jointIndex];
mat4f globalJointTransform = tm.getWorldTransform(tm.getInstance(jointEntity));
mat4f inverseBindMatrix = prim.skin->inverseBindMatrices[jointIndex];
tmp += weights[i][j] * globalJointTransform * inverseBindMatrix;
}
mat4f skinMatrix = inverseGlobalTransform * tmp;
if (!pImpl->mNormalizeSkinningWeights) {
skinMatrix /= skinMatrix[3].w;
}
float3 skinnedPoint = (point.x * skinMatrix[0] +
point.y * skinMatrix[1] + point.z * skinMatrix[2] + skinMatrix[3]).xyz;
aabb.min = min(aabb.min, skinnedPoint);
aabb.max = max(aabb.max, skinnedPoint);
}
*result = aabb;
};
// Collect all mesh primitives that we wish to find bounds for. For each mesh primitive, we also
// collect the skin it bound to (nullptr if not skinned) for bounds computation.
std::vector<std::pair<cgltf_primitive*, const Skin*>> primitives;
// collect the skin it is bound to (nullptr if not skinned) for bounds computation.
size_t primCount = 0;
for (auto iter : nodeMap) {
const Skin* skin = nullptr;
cgltf_skin* const cgltfSkin = iter.first->skin;
if (cgltfSkin) {
// importSkins unpacked cgltfSkin into FFilamentInstance::SkinVector bijectively so that
// the unpacked Skin can be retrieved given cgltfSkin index
int skinIndex = cgltfSkin - pImpl->mSkinBaseAddress;
skin = &asset->mSkins[skinIndex];
const cgltf_mesh* mesh = iter.first->mesh;
if (mesh) {
primCount += mesh->primitives_count;
}
const cgltf_mesh* cgltfMesh = iter.first->mesh;
if (cgltfMesh) {
for (cgltf_size index = 0, nprims = cgltfMesh->primitives_count; index < nprims; ++index) {
primitives.push_back({&cgltfMesh->primitives[index], skin});
}
auto primitives = FixedCapacityVector<Prim>::with_capacity(primCount);
const cgltf_skin* baseSkin = &asset->mSourceAsset->hierarchy->skins[0];
for (auto iter : nodeMap) {
const cgltf_mesh* mesh = iter.first->mesh;
if (mesh) {
for (cgltf_size index = 0, nprims = mesh->primitives_count; index < nprims; ++index) {
primitives.push_back({&mesh->primitives[index], nullptr, iter.second});
}
if (cgltf_skin* const skin = iter.first->skin; skin) {
primitives.back().skin = &asset->mSkins[skin - baseSkin];
}
}
}
// Kick off a bounding box job for every primitive.
std::vector<Aabb> bounds(primitives.size());
FixedCapacityVector<Aabb> bounds(primitives.size());
JobSystem* js = &pImpl->mEngine->getJobSystem();
JobSystem::Job* parent = js->createJob();
for (size_t i = 0; i < primitives.size(); ++i) {
Aabb* result = &bounds[i];
if (pImpl->mIgnoreBindTransform || !primitives[i].second) {
cgltf_primitive const* prim = primitives[i].first;
if (pImpl->mIgnoreBindTransform || primitives[i].skin == nullptr) {
cgltf_primitive const* prim = primitives[i].prim;
js->run(jobs::createJob(*js, parent, [prim, result, computeBoundingBox] {
computeBoundingBox(prim, result);
}));
} else {
std::pair<cgltf_primitive*, const Skin*> skinnedPrimitive = primitives[i];
js->run(jobs::createJob(*js, parent, [skinnedPrimitive, result, computeBoundingBoxSkinned] {
computeBoundingBoxSkinned(skinnedPrimitive.first, skinnedPrimitive.second, result);
const Prim& prim = primitives[i];
js->run(jobs::createJob(*js, parent, [&prim, result, computeBoundingBoxSkinned] {
computeBoundingBoxSkinned(prim, result);
}));
}
}
+1 -1
View File
@@ -162,7 +162,7 @@ public:
}
void free(void* p, size_t) noexcept {
free(p);
this->free(p);
}
~HeapAllocator() noexcept = default;
+3 -5
View File
@@ -30,15 +30,13 @@
namespace utils {
inline void* aligned_alloc(size_t size, size_t align) noexcept {
// 'align' must be a power of two and a multiple of sizeof(void*)
align = (align < sizeof(void*)) ? sizeof(void*) : align;
assert(align && !(align & align - 1));
assert((align % sizeof(void*)) == 0);
void* p = nullptr;
// must be a power of two and >= sizeof(void*)
while (align < sizeof(void*)) {
align <<= 1u;
}
#if defined(WIN32)
p = ::_aligned_malloc(size, align);
#else
+1 -1
View File
@@ -82,7 +82,7 @@ ostream& LogStream::flush() noexcept {
#endif
break;
}
#endif // ANDROID
#endif // __ANDROID__
buf.reset();
return *this;
}
+3 -3
View File
@@ -408,10 +408,10 @@ void ViewerGui::setAsset(FilamentAsset* asset, FilamentInstance* instanceToAnim
assert_invariant(mAnimator && "Call loadResources or asyncBeginLoad before setAsset.");
updateRootTransform();
mScene->addEntities(asset->getLightEntities(), asset->getLightEntityCount());
auto& tcm = mEngine->getRenderableManager();
auto& rcm = mEngine->getRenderableManager();
for (size_t i = 0, n = asset->getRenderableEntityCount(); i < n; i++) {
auto ri = tcm.getInstance(asset->getRenderableEntities()[i]);
tcm.setScreenSpaceContactShadows(ri, true);
auto ri = rcm.getInstance(asset->getRenderableEntities()[i]);
rcm.setScreenSpaceContactShadows(ri, true);
}
}
}
-22
View File
@@ -268,28 +268,6 @@ if (NOT ANDROID)
install(DIRECTORY ${PROJECT_BINARY_DIR}/assets/ibl/ DESTINATION bin/assets)
endif()
# ==================================================================================================
# Copy the MoltenVK dylibs and JSON on MacOS
# ==================================================================================================
if (APPLE AND NOT Vulkan_LIBRARY AND NOT FILAMENT_USE_SWIFTSHADER)
message(STATUS "No Vulkan SDK was found, using prebuilt MoltenVK.")
set(MOLTENVK_DIR "../third_party/moltenvk")
configure_file(
${MOLTENVK_DIR}/libvulkan.1.dylib
${PROJECT_BINARY_DIR}/libvulkan.1.dylib COPYONLY)
configure_file(
${MOLTENVK_DIR}/MoltenVK_icd.json
${PROJECT_BINARY_DIR}/MoltenVK_icd.json COPYONLY)
configure_file(
${MOLTENVK_DIR}/libMoltenVK.dylib
${PROJECT_BINARY_DIR}/libMoltenVK.dylib COPYONLY)
list(APPEND APP_SRCS
${PROJECT_BINARY_DIR}/libvulkan.1.dylib
${PROJECT_BINARY_DIR}/MoltenVK_icd.json
${PROJECT_BINARY_DIR}/libMoltenVK.dylib)
endif()
# ==================================================================================================
# Copy Assets
#
+1 -1
View File
@@ -138,7 +138,7 @@ static void printUsage(char* name) {
" --recompute-aabb, -r\n"
" Ignore the min/max attributes in the glTF file\n\n"
" --ignore-bind-transform, -g\n"
" Ignore bind transform when recomputing aabb\n\n"
" Ignore bind transform when recomputing aabb (use with -r)\n\n"
" --settings=<path to JSON file>, -t\n"
" Apply the settings in the given JSON file\n\n"
" --ubershader, -u\n"
+9 -3
View File
@@ -4,7 +4,6 @@ cmake_minimum_required(VERSION 3.19)
set(TRANSCODER_SRC
../transcoder/basisu_transcoder.cpp
../zstd/zstd.c
)
set(ENCODER_SRC
@@ -51,9 +50,14 @@ else()
set (BASIS_CONFIG ${BASIS_CONFIG} BASISD_SUPPORT_DXT5A=0 BASISD_SUPPORT_DXT1=0)
endif()
add_library(basis_encoder ${ENCODER_SRC} ${TRANSCODER_SRC})
add_library(zstd ../zstd/zstd.c)
add_library(basis_encoder ${ENCODER_SRC})
add_library(basis_transcoder ${TRANSCODER_SRC})
target_link_libraries(basis_transcoder zstd)
target_link_libraries(basis_encoder basis_transcoder)
target_include_directories(zstd PUBLIC ../zstd)
target_include_directories(basis_encoder PUBLIC ../encoder)
target_include_directories(basis_transcoder PUBLIC ../transcoder)
@@ -61,7 +65,8 @@ target_compile_definitions(basis_encoder PRIVATE ${BASIS_CONFIG})
target_compile_definitions(basis_transcoder PRIVATE ${BASIS_CONFIG})
if (IS_HOST_PLATFORM)
add_executable(basisu ${ENCODER_SRC} ${TRANSCODER_SRC} ../basisu_tool.cpp)
add_executable(basisu ../basisu_tool.cpp)
target_link_libraries(basisu basis_encoder)
target_compile_definitions(basisu PRIVATE ${BASIS_CONFIG})
install(TARGETS basisu DESTINATION bin)
@@ -71,3 +76,4 @@ if (IS_HOST_PLATFORM)
endif()
install(TARGETS basis_transcoder ARCHIVE DESTINATION lib/${DIST_DIR})
install(TARGETS zstd ARCHIVE DESTINATION lib/${DIST_DIR})
Binary file not shown.
Binary file not shown.
+2
View File
@@ -12,6 +12,8 @@ unzip imgui.zip
rsync -r imgui-1.77/ imgui/ --delete
git checkout imgui/tnt
rm -rf imgui-1.77 imgui.zip
rm imgui/examples/libs/glfw/lib-vc2010-32/*.lib
rm imgui/examples/libs/glfw/lib-vc2010-64/*.lib
git add imgui
```
-202
View File
@@ -1,202 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-7
View File
@@ -1,7 +0,0 @@
{
"file_format_version" : "1.0.0",
"ICD": {
"library_path": "./libMoltenVK.dylib",
"api_version" : "1.0.0"
}
}
-18
View File
@@ -1,18 +0,0 @@
# third_party/moltenvk
This folder contains prebuilt dylib files extracted from `macOS/lib` in the following LunarG SDK:
vulkansdk-macos-1.2.182.0.dmg
The purpose of these files is to allow Filament developers to avoid installing the LunarG SDK.
However, to enable validation you must install the SDK.
# Enabling validation on macOS
If you wish to enable validation or use a newer version of MoltenVK than what is included in the
Filament repo, please do the following.
1. Download and execute the latest dmg file from https://vulkan.lunarg.com/sdk/home
2. To set environment variables such as VK_ICD_FILENAMES etc, go to the SDK folder and do
`source setup-env.sh`.
Binary file not shown.
Binary file not shown.
-35
View File
@@ -1,35 +0,0 @@
cmake_minimum_required(VERSION 2.8.12)
project(moltenvk)
set(OUTPUT_LIBVK ${CMAKE_CURRENT_BINARY_DIR}/../libvulkan.1.dylib)
set(INPUT_LIBVK ${CMAKE_CURRENT_SOURCE_DIR}/../libvulkan.1.dylib)
set(OUTPUT_ICD ${CMAKE_CURRENT_BINARY_DIR}/../libMoltenVK.dylib)
set(INPUT_ICD ${CMAKE_CURRENT_SOURCE_DIR}/../libMoltenVK.dylib)
set(OUTPUT_JSON ${CMAKE_CURRENT_BINARY_DIR}/../MoltenVK_icd.json)
set(INPUT_JSON ${CMAKE_CURRENT_SOURCE_DIR}/../MoltenVK_icd.json)
# Define a build step that simply copies the dylib to the destination.
add_custom_command(
OUTPUT ${OUTPUT_LIBVK}
COMMAND ${CMAKE_COMMAND} -E copy ${INPUT_LIBVK} ${OUTPUT_LIBVK})
add_custom_command(
OUTPUT ${OUTPUT_ICD}
COMMAND ${CMAKE_COMMAND} -E copy ${INPUT_ICD} ${OUTPUT_ICD})
add_custom_command(
OUTPUT ${OUTPUT_JSON}
COMMAND ${CMAKE_COMMAND} -E copy ${INPUT_JSON} ${OUTPUT_JSON})
# Define a fictional artifact called "moltenvk" that depends on the dylib.
add_custom_target(moltenvk ALL DEPENDS ${OUTPUT_LIBVK} ${OUTPUT_ICD} ${OUTPUT_JSON})
# Install all the molten files alongside libfilament in /usr/local/lib/${ARCH}
# Only install on Desktop- iOS links against ../ios/libMoltenVK.dylib
if(APPLE AND NOT IOS)
install(FILES ${OUTPUT_LIBVK} DESTINATION lib/${DIST_DIR})
install(FILES ${OUTPUT_ICD} DESTINATION lib/${DIST_DIR})
install(FILES ${OUTPUT_JSON} DESTINATION lib/${DIST_DIR})
endif()
+2 -1
View File
@@ -2,7 +2,7 @@
.ycm_extra_conf.py*
*.pyc
compile_commands.json
/build/
/build*/
/buildtools/
/external/googletest
/external/effcee
@@ -18,6 +18,7 @@ bazel-bin
bazel-genfiles
bazel-out
bazel-spirv-tools
bazel-SPIRV-Tools
bazel-testlogs
# Vim
+7 -2
View File
@@ -106,8 +106,10 @@ SPVTOOLS_OPT_SRC_FILES := \
source/opt/eliminate_dead_constant_pass.cpp \
source/opt/eliminate_dead_functions_pass.cpp \
source/opt/eliminate_dead_functions_util.cpp \
source/opt/eliminate_dead_input_components_pass.cpp \
source/opt/eliminate_dead_members_pass.cpp \
source/opt/feature_manager.cpp \
source/opt/fix_func_call_arguments.cpp \
source/opt/fix_storage_class.cpp \
source/opt/flatten_decoration_pass.cpp \
source/opt/fold.cpp \
@@ -126,6 +128,7 @@ SPVTOOLS_OPT_SRC_FILES := \
source/opt/instruction.cpp \
source/opt/instruction_list.cpp \
source/opt/instrument_pass.cpp \
source/opt/interface_var_sroa.cpp \
source/opt/interp_fixup_pass.cpp \
source/opt/ir_context.cpp \
source/opt/ir_loader.cpp \
@@ -156,6 +159,7 @@ SPVTOOLS_OPT_SRC_FILES := \
source/opt/redundancy_elimination.cpp \
source/opt/register_pressure.cpp \
source/opt/relax_float_ops_pass.cpp \
source/opt/remove_dontinline_pass.cpp \
source/opt/remove_duplicates_pass.cpp \
source/opt/remove_unused_interface_variables_pass.cpp \
source/opt/replace_desc_array_access_using_var_index.cpp \
@@ -165,10 +169,11 @@ SPVTOOLS_OPT_SRC_FILES := \
source/opt/scalar_replacement_pass.cpp \
source/opt/set_spec_constant_default_value_pass.cpp \
source/opt/simplification_pass.cpp \
source/opt/spread_volatile_semantics.cpp \
source/opt/ssa_rewrite_pass.cpp \
source/opt/strength_reduction_pass.cpp \
source/opt/strip_debug_info_pass.cpp \
source/opt/strip_reflect_info_pass.cpp \
source/opt/strip_nonsemantic_info_pass.cpp \
source/opt/struct_cfg_analysis.cpp \
source/opt/type_manager.cpp \
source/opt/types.cpp \
@@ -299,7 +304,7 @@ $(1)/build-version.inc: \
$(LOCAL_PATH)/utils/update_build_version.py \
$(LOCAL_PATH)/CHANGES
@$(HOST_PYTHON) $(LOCAL_PATH)/utils/update_build_version.py \
$(LOCAL_PATH) $(1)/build-version.inc
$(LOCAL_PATH)/CHANGES $(1)/build-version.inc
@echo "[$(TARGET_ARCH_ABI)] Generate : build-version.inc <= CHANGES"
$(LOCAL_PATH)/source/software_version.cpp: $(1)/build-version.inc
endef
+3 -1
View File
@@ -81,6 +81,7 @@ genrule(
srcs = ["@spirv_headers//:spirv_xml_registry"],
outs = ["generators.inc"],
cmd = "$(location generate_registry_tables) --xml=$(location @spirv_headers//:spirv_xml_registry) --generator-output=$(location generators.inc)",
cmd_bat = "$(location //:generate_registry_tables) --xml=$(location @spirv_headers//:spirv_xml_registry) --generator-output=$(location generators.inc)",
tools = [":generate_registry_tables"],
)
@@ -93,7 +94,8 @@ genrule(
name = "gen_build_version",
srcs = ["CHANGES"],
outs = ["build-version.inc"],
cmd = "SOURCE_DATE_EPOCH=0 $(location update_build_version) $$(dirname $(location CHANGES)) $(location build-version.inc)",
cmd = "SOURCE_DATE_EPOCH=0 $(location update_build_version) $(location CHANGES) $(location build-version.inc)",
cmd_bat = "set SOURCE_DATE_EPOCH=0 && $(location //:update_build_version) $(location CHANGES) $(location build-version.inc)",
tools = [":update_build_version"],
)
+113 -86
View File
@@ -19,6 +19,17 @@ if (build_with_chromium) {
import("//third_party/protobuf/proto_library.gni")
}
# SPIRV-Tools may be part of multiple projects in the Chromium tree.
# Only enable building executables if this is the main copy.
abspath = get_path_info(".", "abspath")
spvtools_chromium_third_party = (abspath == "//third_party/vulkan-deps/spirv-tools/src/")
spvtools_build_executables = build_with_chromium && spvtools_chromium_third_party
# Fuchsia also requires building the executables.
# TODO(b/158002593): Avoid the use of dependent-specific variables.
if (defined(is_fuchsia_tree) && is_fuchsia_tree) {
spvtools_build_executables = true
}
spirv_headers = spirv_tools_spirv_headers_dir
spirv_is_winuwp = is_win && target_os == "winuwp"
@@ -245,12 +256,12 @@ action("spvtools_generators_inc") {
action("spvtools_build_version") {
script = "utils/update_build_version.py"
src_dir = "."
changes_file = "CHANGES"
inc_file = "${target_gen_dir}/build-version.inc"
outputs = [ inc_file ]
args = [
rebase_path(src_dir, root_build_dir),
rebase_path(changes_file, root_build_dir),
rebase_path(inc_file, root_build_dir),
]
}
@@ -448,12 +459,14 @@ static_library("spvtools") {
"source/util/bit_vector.cpp",
"source/util/bit_vector.h",
"source/util/bitutils.h",
"source/util/hash_combine.h",
"source/util/hex_float.h",
"source/util/ilist.h",
"source/util/ilist_node.h",
"source/util/make_unique.h",
"source/util/parse_number.cpp",
"source/util/parse_number.h",
"source/util/pooled_linked_list.h",
"source/util/small_vector.h",
"source/util/string_utils.cpp",
"source/util/string_utils.h",
@@ -609,11 +622,15 @@ static_library("spvtools_opt") {
"source/opt/eliminate_dead_functions_pass.h",
"source/opt/eliminate_dead_functions_util.cpp",
"source/opt/eliminate_dead_functions_util.h",
"source/opt/eliminate_dead_input_components_pass.cpp",
"source/opt/eliminate_dead_input_components_pass.h",
"source/opt/eliminate_dead_members_pass.cpp",
"source/opt/eliminate_dead_members_pass.h",
"source/opt/empty_pass.h",
"source/opt/feature_manager.cpp",
"source/opt/feature_manager.h",
"source/opt/fix_func_call_arguments.cpp",
"source/opt/fix_func_call_arguments.h",
"source/opt/fix_storage_class.cpp",
"source/opt/fix_storage_class.h",
"source/opt/flatten_decoration_pass.cpp",
@@ -650,6 +667,8 @@ static_library("spvtools_opt") {
"source/opt/instruction_list.h",
"source/opt/instrument_pass.cpp",
"source/opt/instrument_pass.h",
"source/opt/interface_var_sroa.cpp",
"source/opt/interface_var_sroa.h",
"source/opt/interp_fixup_pass.cpp",
"source/opt/interp_fixup_pass.h",
"source/opt/ir_builder.h",
@@ -714,6 +733,8 @@ static_library("spvtools_opt") {
"source/opt/register_pressure.h",
"source/opt/relax_float_ops_pass.cpp",
"source/opt/relax_float_ops_pass.h",
"source/opt/remove_dontinline_pass.cpp",
"source/opt/remove_dontinline_pass.h",
"source/opt/remove_duplicates_pass.cpp",
"source/opt/remove_duplicates_pass.h",
"source/opt/remove_unused_interface_variables_pass.cpp",
@@ -732,14 +753,16 @@ static_library("spvtools_opt") {
"source/opt/set_spec_constant_default_value_pass.h",
"source/opt/simplification_pass.cpp",
"source/opt/simplification_pass.h",
"source/opt/spread_volatile_semantics.cpp",
"source/opt/spread_volatile_semantics.h",
"source/opt/ssa_rewrite_pass.cpp",
"source/opt/ssa_rewrite_pass.h",
"source/opt/strength_reduction_pass.cpp",
"source/opt/strength_reduction_pass.h",
"source/opt/strip_debug_info_pass.cpp",
"source/opt/strip_debug_info_pass.h",
"source/opt/strip_reflect_info_pass.cpp",
"source/opt/strip_reflect_info_pass.h",
"source/opt/strip_nonsemantic_info_pass.cpp",
"source/opt/strip_nonsemantic_info_pass.h",
"source/opt/struct_cfg_analysis.cpp",
"source/opt/struct_cfg_analysis.h",
"source/opt/tree_iterator.h",
@@ -869,7 +892,7 @@ static_library("spvtools_reduce") {
configs += [ ":spvtools_internal_config" ]
}
if (build_with_chromium) {
if (build_with_chromium && spvtools_build_executables) {
# The spirv-fuzz library is only built when in a Chromium checkout
# due to its dependency on protobuf.
@@ -1298,7 +1321,7 @@ group("SPIRV-Tools") {
# The tests are scoped to Chromium to avoid needing to write gtest integration.
# See Chromium's third_party/googletest/BUILD.gn for a complete integration.
if (build_with_chromium) {
if (build_with_chromium && spvtools_build_executables) {
test("spvtools_test") {
sources = [
"test/assembly_context_test.cpp",
@@ -1407,73 +1430,75 @@ source_set("spvtools_software_version") {
configs += [ ":spvtools_internal_config" ]
}
executable("spirv-as") {
sources = [ "tools/as/as.cpp" ]
deps = [
":spvtools",
":spvtools_software_version",
]
configs += [ ":spvtools_internal_config" ]
if (spvtools_build_executables) {
executable("spirv-as") {
sources = [ "tools/as/as.cpp" ]
deps = [
":spvtools",
":spvtools_software_version",
]
configs += [ ":spvtools_internal_config" ]
}
executable("spirv-dis") {
sources = [ "tools/dis/dis.cpp" ]
deps = [
":spvtools",
":spvtools_software_version",
]
configs += [ ":spvtools_internal_config" ]
}
executable("spirv-val") {
sources = [ "tools/val/val.cpp" ]
deps = [
":spvtools",
":spvtools_software_version",
":spvtools_util_cli_consumer",
":spvtools_val",
]
configs += [ ":spvtools_internal_config" ]
}
executable("spirv-cfg") {
sources = [
"tools/cfg/bin_to_dot.cpp",
"tools/cfg/bin_to_dot.h",
"tools/cfg/cfg.cpp",
]
deps = [
":spvtools",
":spvtools_software_version",
]
configs += [ ":spvtools_internal_config" ]
}
executable("spirv-opt") {
sources = [ "tools/opt/opt.cpp" ]
deps = [
":spvtools",
":spvtools_opt",
":spvtools_software_version",
":spvtools_util_cli_consumer",
":spvtools_val",
]
configs += [ ":spvtools_internal_config" ]
}
executable("spirv-link") {
sources = [ "tools/link/linker.cpp" ]
deps = [
":spvtools",
":spvtools_link",
":spvtools_opt",
":spvtools_software_version",
":spvtools_val",
]
configs += [ ":spvtools_internal_config" ]
}
}
executable("spirv-dis") {
sources = [ "tools/dis/dis.cpp" ]
deps = [
":spvtools",
":spvtools_software_version",
]
configs += [ ":spvtools_internal_config" ]
}
executable("spirv-val") {
sources = [ "tools/val/val.cpp" ]
deps = [
":spvtools",
":spvtools_software_version",
":spvtools_util_cli_consumer",
":spvtools_val",
]
configs += [ ":spvtools_internal_config" ]
}
executable("spirv-cfg") {
sources = [
"tools/cfg/bin_to_dot.cpp",
"tools/cfg/bin_to_dot.h",
"tools/cfg/cfg.cpp",
]
deps = [
":spvtools",
":spvtools_software_version",
]
configs += [ ":spvtools_internal_config" ]
}
executable("spirv-opt") {
sources = [ "tools/opt/opt.cpp" ]
deps = [
":spvtools",
":spvtools_opt",
":spvtools_software_version",
":spvtools_util_cli_consumer",
":spvtools_val",
]
configs += [ ":spvtools_internal_config" ]
}
executable("spirv-link") {
sources = [ "tools/link/linker.cpp" ]
deps = [
":spvtools",
":spvtools_link",
":spvtools_opt",
":spvtools_software_version",
":spvtools_val",
]
configs += [ ":spvtools_internal_config" ]
}
if (!is_ios && !spirv_is_winuwp && build_with_chromium) {
if (!is_ios && !spirv_is_winuwp && build_with_chromium && spvtools_build_executables) {
# iOS and UWP do not allow std::system calls which spirv-fuzz
# requires. Additionally, spirv-fuzz is only built when in a
# Chromium checkout due to its dependency on protobuf.
@@ -1494,7 +1519,7 @@ if (!is_ios && !spirv_is_winuwp && build_with_chromium) {
}
}
if (!is_ios && !spirv_is_winuwp) {
if (!is_ios && !spirv_is_winuwp && spvtools_build_executables) {
# iOS and UWP do not allow std::system calls which spirv-reduce
# requires.
@@ -1512,19 +1537,21 @@ if (!is_ios && !spirv_is_winuwp) {
}
}
group("all_spirv_tools") {
deps = [
":spirv-as",
":spirv-cfg",
":spirv-dis",
":spirv-link",
":spirv-opt",
":spirv-val",
]
if (!is_ios && !spirv_is_winuwp && build_with_chromium) {
deps += [ ":spirv-fuzz" ]
}
if (!is_ios && !spirv_is_winuwp) {
deps += [ ":spirv-reduce" ]
if (spvtools_build_executables){
group("all_spirv_tools") {
deps = [
":spirv-as",
":spirv-cfg",
":spirv-dis",
":spirv-link",
":spirv-opt",
":spirv-val",
]
if (!is_ios && !spirv_is_winuwp && build_with_chromium) {
deps += [ ":spirv-fuzz" ]
}
if (!is_ios && !spirv_is_winuwp) {
deps += [ ":spirv-reduce" ]
}
}
}
+64
View File
@@ -1,5 +1,69 @@
Revision history for SPIRV-Tools
v2022.3-dev 2022-04-07
- Start v2022.3-dev
v2022.2 2022-04-07
- General
- Add OpModuleProcessed to debug opcode (#4694)
- Optimizer
- Complete handling of RayQueryKHR type (#4690)
- Have scalar replacement use undef instead of null (#4691)
- Optimize Instruction::Instruction (#4705)
- Handle propagation of arrays with decorations (#4717)
- spirv-opt: Add OpExecutionModeId support (#4719)
- Optimize Type::HashValue (#4707)
- Optimize DefUseManager allocations (#4709)
- Add pass to remove DontInline function control (#4747)
- Better handling of 0xFFFFFFFF when folding vector shuffle (#4743)
- Reset the id bound on the module in compact ids (#4744)
- spirv-opt: (WIP) Eliminate Dead Input Component Pass (#4720)
- Support SPV_KHR_uniform_group_instructions (#4734)
- Handle shaders without execution model in spread-volatile-semantics (#4766)
- Validator
- Fix handling of Nontemporal image operand (#4692)
- [spirv-val] Allow 0 Component Count for DebugTypeArray for Shader (#4706)
- spirv-val: Validate DebugTypeMatrix (#4732)
- spirv-val: Label Vulkan VUID 04734 (#4739)
- spirv-val: Label VUID 06491 (#4745)
- spirv-val: Disallow array of push constants (#4742)
- spirv-val: Label Vulkan RuntimeArray VUID (#4749)
- spirv-val: Add Vulkan Image VUID 06214 (#4750)
- spirv-val: Add Vulkan Dref not allowed 3D dim VUID (#4751)
- spirv-val: Label and add test for PSB Aligned (#4756)
- spirv-val: Add Vulkan 32-bit bit op Base (#4758)
- spirv-val: Add more Vulkan VUID labels (#4764)
- Diff
- Introduce spirv-diff (#4611)
- Stabilize the output of spirv-diff (#4698)
- spirv-diff: Handle OpSpecConstant array sizes (#4700)
- spirv-diff: Match OpSpecConstantComposite correctly (#4704)
- spirv-diff: Use GetSingleWord*Operand (#4768)
- spirv-diff: Basic support for OpTypeForwardPointer (#4761)
- spirv-diff: Fix OpTypeFunction matching w.r.t operand count (#4771)
v2022.1 2022-01-26
- General
- Add SPIR-V 1.6 support to wasm build (#4674)
- Improvements to disassembly within PassManager (#4677)
- Basic support for SPIR-V 1.6 (#4663)
- reflect debug (#4662)
- Fix endianness of string literals (#4622)
- Optimizer
- spirv-opt: add pass to Spread Volatile semantics (#4667)
- Fix constant propagation and folding of FClamp instructions (#4651)
- Manually fold floating point division by zero (#4637)
- Allow ADCE to remove dead inputs (#4629)
- Linker
- Linker improvements (#4679)
* test/linker: Code factorisation and small tweaks
* linker: Do not fail when going over limits
- Validator
- val: interface struct with builtins must be Block (#4665)
- Fuzzer
- Avoid id bound errors during opt fuzzing (#4658)
- Avoid uninitialised read when parsing hex float (#4646)
v2021.4 2021-11-11
- General
- Add a WebAssembly build (#3752)
+4 -58
View File
@@ -24,19 +24,14 @@ if (POLICY CMP0054)
endif()
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Filament specific changes
if (APPLE)
set(CMAKE_MACOSX_RPATH ON)
endif (APPLE)
set(SPIRV_SKIP_EXECUTABLES_OPTION ON)
set(SPIRV_SKIP_TESTS_OPTION ON)
set(SKIP_SPIRV_TOOLS_INSTALL ON)
# End Filament specific changes
project(spirv-tools)
# Filament specific changes
# enable_testing()
# End Filament specific changes
set(SPIRV_TOOLS "SPIRV-Tools")
include(GNUInstallDirs)
@@ -82,9 +77,6 @@ if ("${CMAKE_BUILD_TYPE}" STREQUAL "")
set(CMAKE_BUILD_TYPE "Debug")
endif()
# Filament specific changes
# option(SKIP_SPIRV_TOOLS_INSTALL "Skip installation" ${SKIP_SPIRV_TOOLS_INSTALL})
# End Filament specific changes
if(NOT ${SKIP_SPIRV_TOOLS_INSTALL})
set(ENABLE_SPIRV_TOOLS_INSTALL ON)
endif()
@@ -101,10 +93,8 @@ set(SPIRV_LIB_FUZZING_ENGINE_LINK_OPTIONS "" CACHE STRING "Used by OSS-Fuzz to c
option(SPIRV_BUILD_LIBFUZZER_TARGETS "Build libFuzzer targets" OFF)
# Filament specific changes
# option(SPIRV_WERROR "Enable error on warning" ON)
set(SPIRV_WERROR OFF)
# End Filament specific changes
if(("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR (("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") AND (NOT CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")))
set(COMPILER_IS_LIKE_GNU TRUE)
endif()
@@ -132,7 +122,7 @@ if(${COMPILER_IS_LIKE_GNU})
set(SPIRV_WARNINGS ${SPIRV_WARNINGS} -Werror)
endif()
elseif(MSVC)
set(SPIRV_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS /wd4800)
set(SPIRV_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS /wd4800 /wd4819)
if(${SPIRV_WERROR})
set(SPIRV_WARNINGS ${SPIRV_WARNINGS} /WX)
@@ -259,14 +249,12 @@ if(NOT COMMAND find_host_program)
endif()
# Tests require Python3
# Filament specific changes
if(CMAKE_VERSION VERSION_LESS "3.12" OR ${CMAKE_SYSTEM_NAME} MATCHES "Windows")
find_host_package(PythonInterp 3 REQUIRED)
else()
find_package(Python3 COMPONENTS Interpreter)
set(PYTHON_EXECUTABLE "${Python3_EXECUTABLE}")
endif()
# End Filament specific changes
# Check for symbol exports on Linux.
# At the moment, this check will fail on the OSX build machines for the Android NDK.
@@ -309,13 +297,13 @@ if(ENABLE_SPIRV_TOOLS_INSTALL)
endif()
# Defaults to OFF if the user didn't set it.
# Filament specific changes
option(SPIRV_SKIP_EXECUTABLES
"Skip building the executable and tests along with the library"
${SPIRV_SKIP_EXECUTABLES_OPTION})
option(SPIRV_SKIP_TESTS
"Skip building tests along with the library" ${SPIRV_SKIP_TESTS_OPTION})
# End Filament specific changes
if ("${SPIRV_SKIP_EXECUTABLES}")
set(SPIRV_SKIP_TESTS ON)
endif()
@@ -359,11 +347,6 @@ endif()
add_subdirectory(source)
add_subdirectory(tools)
# Filament specific changes
#add_subdirectory(test)
#add_subdirectory(examples)
# End Filament specific changes
if(ENABLE_SPIRV_TOOLS_INSTALL)
install(
FILES
@@ -384,40 +367,3 @@ endif()
set(SPIRV_LIBRARIES "-lSPIRV-Tools-opt -lSPIRV-Tools -lSPIRV-Tools-link")
set(SPIRV_SHARED_LIBRARIES "-lSPIRV-Tools-shared")
# Build pkg-config file
# Use a first-class target so it's regenerated when relevant files are updated.
# Filament specific changes
# add_custom_target(spirv-tools-pkg-config ALL
# COMMAND ${CMAKE_COMMAND}
# -DCHANGES_FILE=${CMAKE_CURRENT_SOURCE_DIR}/CHANGES
# -DTEMPLATE_FILE=${CMAKE_CURRENT_SOURCE_DIR}/cmake/SPIRV-Tools.pc.in
# -DOUT_FILE=${CMAKE_CURRENT_BINARY_DIR}/SPIRV-Tools.pc
# -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
# -DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
# -DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_INSTALL_INCLUDEDIR}
# -DSPIRV_LIBRARIES=${SPIRV_LIBRARIES}
# -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/write_pkg_config.cmake
# DEPENDS "CHANGES" "cmake/SPIRV-Tools.pc.in" "cmake/write_pkg_config.cmake")
# add_custom_target(spirv-tools-shared-pkg-config ALL
# COMMAND ${CMAKE_COMMAND}
# -DCHANGES_FILE=${CMAKE_CURRENT_SOURCE_DIR}/CHANGES
# -DTEMPLATE_FILE=${CMAKE_CURRENT_SOURCE_DIR}/cmake/SPIRV-Tools-shared.pc.in
# -DOUT_FILE=${CMAKE_CURRENT_BINARY_DIR}/SPIRV-Tools-shared.pc
# -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
# -DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
# -DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_INSTALL_INCLUDEDIR}
# -DSPIRV_SHARED_LIBRARIES=${SPIRV_SHARED_LIBRARIES}
# -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/write_pkg_config.cmake
# DEPENDS "CHANGES" "cmake/SPIRV-Tools-shared.pc.in" "cmake/write_pkg_config.cmake")
# End Filament specific changes
# Install pkg-config file
if (ENABLE_SPIRV_TOOLS_INSTALL)
install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/SPIRV-Tools.pc
${CMAKE_CURRENT_BINARY_DIR}/SPIRV-Tools-shared.pc
DESTINATION
${CMAKE_INSTALL_LIBDIR}/pkgconfig)
endif()
+3 -3
View File
@@ -4,9 +4,9 @@ vars = {
'github': 'https://github.com',
'effcee_revision': 'ddf5e2bb92957dc8a12c5392f8495333d6844133',
'googletest_revision': 'bf0701daa9f5b30e5882e2f8f9a5280bcba87e77',
're2_revision': '4244cd1cb492fa1d10986ec67f862964c073f844',
'spirv_headers_revision': '814e728b30ddd0f4509233099a3ad96fd4318c07',
'googletest_revision': '25dcdc7e8bfac8967f20fb2c0a628f5cf442188d',
're2_revision': '0c5616df9c0aaa44c9440d87422012423d91c7d1',
'spirv_headers_revision': 'b765c355f488837ca4c77980ba69484f3ff277f5',
}
deps = {
+11 -7
View File
@@ -1,9 +1,6 @@
When updating spirv-tools to a new version, make sure to preserve all the changes marked with
the following in `CMakeLists.txt` and `source/CMakeLists.txt`:
`# Filament specific changes`
You can easily apply these changes by running the following command at Filament's root:
When updating spirv-tools to a new version there are several `CMakeLists.txt` files that need
to patched with Filament specific changes. This can be done by running the following command at
Filament's root:
```
git apply third_party/spirv-tools/filament-specific-changes.patch
@@ -25,6 +22,13 @@ rm master.zip
git add spirv-tools
```
Edit the .gitignore so it doesn't prevent `spirv-headers` from being committed.
The patch file also edits the `.gitignore` to allow `spirv-headers` to be committed.
Finally, remember to bring back the Filament-specific changes in CMakeLists.
To restore this file and the patch file do:
```
git checkout main spirv-tools/FILAMENT_README.md
git checkout main spirv-tools/filament-specific-changes.patch
```
+28 -1
View File
@@ -212,6 +212,24 @@ issue](https://github.com/KhronosGroup/SPIRV-Tools/issues]) with
"Fuzzer:" as the start of its title.
### Diff
*Note:* The diff tool is still under development.
The diff tool takes two SPIR-V files, either in binary or text format and
produces a diff-style comparison between the two. The instructions between the
src and dst modules are matched as best as the tool can, and output is produced
(in src id-space) that shows which instructions are removed in src, added in dst
or modified between them. The order of instructions are not retained.
Matching instructions between two SPIR-V modules is not trivial, and thus a
number of heuristics are applied in this tool. In particular, without debug
information, match functions is nontrivial as they can be reordered. As such,
this tool is primarily useful to produce the diff of two SPIR-V modules derived
from the same source, for example before and after a modification to the shader,
before and after a transformation, or SPIR-V produced from different tools.
### Extras
* [Utility filters](#utility-filters)
@@ -399,7 +417,7 @@ targets, you need to install CMake Version 2.8.12 or later.
- [Python 3](http://www.python.org/): for utility scripts and running the test
suite.
- [Bazel](https://bazel.build/) (optional): if building the source with Bazel,
you need to install Bazel Version 0.29.1 on your machine. Other versions may
you need to install Bazel Version 5.0.0 on your machine. Other versions may
also work, but are not verified.
- [Emscripten SDK](https://emscripten.org) (optional): if building the
WebAssembly module.
@@ -624,6 +642,15 @@ This is experimental.
* `spirv-cfg` - the control flow graph dumper
* `<spirv-dir>/tools/cfg`
### Diff tool
*Warning:* This functionality is under development, and is incomplete.
The diff tool produces a diff-style comparison between two SPIR-V modules.
* `spirv-diff` - the standalone diff tool
* `<spirv-dir>`/tools/diff`
### Utility filters
* `spirv-lesspipe.sh` - Automatically disassembles `.spv` binary files for the
+37
View File
@@ -68,6 +68,14 @@ def generate_core_tables(version = None):
"--core-insts-output=$(location {3}) " +
"--operand-kinds-output=$(location {4})"
).format(*fmtargs),
cmd_bat = (
"$(location :generate_grammar_tables) " +
"--spirv-core-grammar=$(location {0}) " +
"--extinst-debuginfo-grammar=$(location {1}) " +
"--extinst-cldebuginfo100-grammar=$(location {2}) " +
"--core-insts-output=$(location {3}) " +
"--operand-kinds-output=$(location {4})"
).format(*fmtargs),
tools = [":generate_grammar_tables"],
visibility = ["//visibility:private"],
)
@@ -97,6 +105,14 @@ def generate_enum_string_mapping(version = None):
"--extension-enum-output=$(location {3}) " +
"--enum-string-mapping-output=$(location {4})"
).format(*fmtargs),
cmd_bat = (
"$(location :generate_grammar_tables) " +
"--spirv-core-grammar=$(location {0}) " +
"--extinst-debuginfo-grammar=$(location {1}) " +
"--extinst-cldebuginfo100-grammar=$(location {2}) " +
"--extension-enum-output=$(location {3}) " +
"--enum-string-mapping-output=$(location {4})"
).format(*fmtargs),
tools = [":generate_grammar_tables"],
visibility = ["//visibility:private"],
)
@@ -118,6 +134,11 @@ def generate_opencl_tables(version = None):
"--extinst-opencl-grammar=$(location {0}) " +
"--opencl-insts-output=$(location {1})"
).format(*fmtargs),
cmd_bat = (
"$(location :generate_grammar_tables) " +
"--extinst-opencl-grammar=$(location {0}) " +
"--opencl-insts-output=$(location {1})"
).format(*fmtargs),
tools = [":generate_grammar_tables"],
visibility = ["//visibility:private"],
)
@@ -139,6 +160,11 @@ def generate_glsl_tables(version = None):
"--extinst-glsl-grammar=$(location {0}) " +
"--glsl-insts-output=$(location {1})"
).format(*fmtargs),
cmd_bat = (
"$(location :generate_grammar_tables) " +
"--extinst-glsl-grammar=$(location {0}) " +
"--glsl-insts-output=$(location {1})"
).format(*fmtargs),
tools = [":generate_grammar_tables"],
visibility = ["//visibility:private"],
)
@@ -161,6 +187,12 @@ def generate_vendor_tables(extension, operand_kind_prefix = ""):
"--vendor-insts-output=$(location {1}) " +
"--vendor-operand-kind-prefix={2}"
).format(*fmtargs),
cmd_bat = (
"$(location :generate_grammar_tables) " +
"--extinst-vendor-grammar=$(location {0}) " +
"--vendor-insts-output=$(location {1}) " +
"--vendor-operand-kind-prefix={2}"
).format(*fmtargs),
tools = [":generate_grammar_tables"],
visibility = ["//visibility:private"],
)
@@ -179,6 +211,11 @@ def generate_extinst_lang_headers(name, grammar = None):
"--extinst-grammar=$< " +
"--extinst-output-path=$(location {0})"
).format(*fmtargs),
cmd_bat = (
"$(location :generate_language_headers) " +
"--extinst-grammar=$< " +
"--extinst-output-path=$(location {0})"
).format(*fmtargs),
tools = [":generate_language_headers"],
visibility = ["//visibility:private"],
)
-4
View File
@@ -45,10 +45,6 @@ if (IS_DIRECTORY ${SPIRV_HEADER_DIR})
# Do this so enclosing projects can use SPIRV-Headers_SOURCE_DIR to find
# headers to include.
if (NOT DEFINED SPIRV-Headers_SOURCE_DIR)
# Filament specific changes
#set(SPIRV_HEADERS_SKIP_INSTALL ON)
#set(SPIRV_HEADERS_SKIP_EXAMPLES ON)
# End Filament specific changes
add_subdirectory(${SPIRV_HEADER_DIR})
endif()
else()
@@ -49,11 +49,9 @@ add_custom_target(install-headers
COMMAND cmake -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/include/spirv
$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/include/spirv)
# Filament specific changes
option(SPIRV_HEADERS_SKIP_EXAMPLES "Skip building examples" ON)
option(SPIRV_HEADERS_SKIP_INSTALL "Skip install" ON)
# End Filament specific changes
if(NOT ${SPIRV_HEADERS_SKIP_EXAMPLES})
set(SPIRV_HEADERS_ENABLE_EXAMPLES ON)
@@ -89,9 +87,14 @@ if (SPIRV_HEADERS_ENABLE_INSTALL)
set(namespace "${PROJECT_NAME}::")
include(CMakePackageConfigHelpers)
if (NOT CMAKE_VERSION VERSION_LESS 3.14)
set(arch_independent_str ARCH_INDEPENDENT)
endif()
write_basic_package_version_file(
"${version_config}"
COMPATIBILITY SameMajorVersion
${arch_independent_str}
)
configure_package_config_file(
@@ -55,7 +55,7 @@
<id value="2" vendor="Valve" comment="Contact TBD"/>
<id value="3" vendor="Codeplay" comment="Contact Victor Lomuller, victor@codeplay.com"/>
<id value="4" vendor="NVIDIA" comment="Contact Kerch Holt, kholt@nvidia.com"/>
<id value="5" vendor="ARM" comment="Contact Alexander Galazin, alexander.galazin@arm.com"/>
<id value="5" vendor="ARM" comment="Contact Kevin Petit, kevin.petit@arm.com"/>
<id value="6" vendor="Khronos" tool="LLVM/SPIR-V Translator" comment="Contact Yaxun (Sam) Liu, yaxun.liu@amd.com"/>
<id value="7" vendor="Khronos" tool="SPIR-V Tools Assembler" comment="Contact David Neto, dneto@google.com"/>
<id value="8" vendor="Khronos" tool="Glslang Reference Front End" comment="Contact John Kessenich, johnkessenich@google.com"/>
@@ -82,7 +82,10 @@
<id value="29" vendor="Mikkosoft Productions" tool="MSP Shader Compiler" comment="Contact Mikko Rasa, tdb@tdb.fi"/>
<id value="30" vendor="SpvGenTwo community" tool="SpvGenTwo SPIR-V IR Tools" comment="https://github.com/rAzoR8/SpvGenTwo"/>
<id value="31" vendor="Google" tool="Skia SkSL" comment="Contact Ethan Nicholas, ethannicholas@google.com"/>
<unused start="32" end="0xFFFF" comment="Tool ID range reservable for future use by vendors"/>
<id value="32" vendor="TornadoVM" tool="SPIRV Beehive Toolkit" comment="https://github.com/beehive-lab/spirv-beehive-toolkit"/>
<id value="33" vendor="DragonJoker" tool="ShaderWriter" comment="Contact Sylvain Doremus, https://github.com/DragonJoker/ShaderWriter"/>
<id value="34" vendor="Rayan Hatout" tool="SPIRVSmith" comment="Contact Rayan Hatout rayan.hatout@gmail.com, Repo https://github.com/rayanht/SPIRVSmith"/>
<unused start="35" end="0xFFFF" comment="Tool ID range reservable for future use by vendors"/>
</ids>
<!-- SECTION: SPIR-V Opcodes and Enumerants -->
@@ -119,7 +122,7 @@
<!-- Begin reservations of opcode enumerants -->
<ids type="opcode" start="0" end="4095" vendor="Khronos" comment="Reserved opcodes, not available to vendors - see the SPIR-V Specification"/>
<ids type="opcode" start="4096" end="4159" vendor="Mesa" comment="Contact TBD"/>
<ids type="opcode" start="4160" end="4415" vendor="ARM"/>
<ids type="opcode" start="4160" end="4415" vendor="ARM" comment="Contact kevin.petit@arm.com"/>
<ids type="opcode" start="4416" end="4479" vendor="Khronos" comment="SPV_ARB_shader_ballot - contact Neil Henning, neil.henning@amd.com"/>
<ids type="opcode" start="4480" end="4991" vendor="Qualcomm" comment="Contact weifengz@qti.qualcomm.com"/>
<ids type="opcode" start="4992" end="5247" vendor="AMD"/>
@@ -148,7 +151,7 @@
<!-- Begin reservations of non-opcode enumerants -->
<ids type="enumerant" start="0" end="4095" vendor="Khronos" comment="Reserved enumerants, not available to vendors - see the SPIR-V Specification"/>
<ids type="enumerant" start="4096" end="4159" vendor="Mesa" comment="Contact TBD"/>
<ids type="enumerant" start="4160" end="4415" vendor="ARM"/>
<ids type="enumerant" start="4160" end="4415" vendor="ARM" comment="Contact kevin.petit@arm.com"/>
<ids type="enumerant" start="4416" end="4479" vendor="Khronos" comment="SPV_ARB_shader_ballot - contact Neil Henning, neil.henning@amd.com"/>
<ids type="enumerant" start="4480" end="4991" vendor="Qualcomm" comment="Contact weifengz@qti.qualcomm.com"/>
<ids type="enumerant" start="4992" end="5247" vendor="AMD"/>
@@ -164,13 +167,14 @@
<ids type="enumerant" start="6144" end="6271" vendor="Intel" comment="Contact michael.kinsner@intel.com"/>
<ids type="enumerant" start="6272" end="6399" vendor="Huawei" comment="Contact wanghuilong2@xunweitech.com"/>
<ids type="enumerant" start="6400" end="6463" vendor="Intel" comment="Contact ben.ashbaugh@intel.com"/>
<ids type="enumerant" start="6464" end="6527" vendor="Mikkosoft Productions" comment="Contact Mikko Rasa, tdb@tdb.fi"/>
<!-- Enumerants to reserve for future use. To get a block, allocate
multiples of 64 starting at the lowest available point in this
block and add a corresponding <ids> tag immediately above. Make
sure to fill in the vendor attribute, and preferably add a contact
person/address in a comment attribute. -->
<!-- Example new block: <ids type="enumerant" start="XXXX" end="XXXX+64n-1" vendor="Add vendor" comment="Contact TBD"/> -->
<ids type="enumerant" start="6464" end="4294967295" comment="Enumerant range reservable for future use by vendors"/>
<ids type="enumerant" start="6528" end="4294967295" comment="Enumerant range reservable for future use by vendors"/>
<!-- End reservations of enumerants -->
@@ -190,8 +194,8 @@
<!-- Reserved loop control bits -->
<ids type="LoopControl" start="0" end="15" vendor="Khronos" comment="Reserved LoopControl bits, not available to vendors - see the SPIR-V Specification"/>
<ids type="LoopControl" start="16" end="24" vendor="Intel" comment="Contact michael.kinsner@intel.com"/>
<ids type="LoopControl" start="25" end="30" comment="Unreserved bits reservable for use by vendors"/>
<ids type="LoopControl" start="16" end="25" vendor="Intel" comment="Contact michael.kinsner@intel.com"/>
<ids type="LoopControl" start="26" end="30" comment="Unreserved bits reservable for use by vendors"/>
<ids type="LoopControl" start="31" end="31" vendor="Khronos" comment="Reserved LoopControl bit, not available to vendors"/>
@@ -26,8 +26,8 @@
],
"magic_number" : "0x07230203",
"major_version" : 1,
"minor_version" : 5,
"revision" : 4,
"minor_version" : 6,
"revision" : 1,
"instruction_printing_class" : [
{
"tag" : "@exclude"
@@ -1735,7 +1735,8 @@
{ "kind" : "IdRef", "name" : "'x'" },
{ "kind" : "IdRef", "name" : "'y'" }
],
"capabilities" : [ "Kernel" ]
"capabilities" : [ "Kernel" ],
"lastVersion" : "1.5"
},
{
"opname" : "OpOrdered",
@@ -4109,7 +4110,7 @@
"SPV_KHR_terminate_invocation"
],
"capabilities" : [ "Shader" ],
"version" : "None"
"version" : "1.6"
},
{
"opname" : "OpSubgroupBallotKHR",
@@ -4182,6 +4183,21 @@
"capabilities" : [ "SubgroupVoteKHR" ],
"version" : "None"
},
{
"opname" : "OpGroupNonUniformRotateKHR",
"class" : "Group",
"opcode" : 4431,
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
{ "kind" : "IdScope", "name" : "'Execution'" },
{ "kind" : "IdRef", "name" : "'Value'" },
{ "kind" : "IdRef", "name" : "'Delta'" },
{ "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" }
],
"capabilities" : [ "GroupNonUniformRotateKHR" ],
"version" : "None"
},
{
"opname" : "OpSubgroupReadInvocationKHR",
"class" : "Group",
@@ -4260,6 +4276,20 @@
"extensions" : [ "SPV_KHR_ray_tracing" ],
"version" : "None"
},
{
"opname" : "OpSDot",
"class" : "Arithmetic",
"opcode" : 4450,
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
{ "kind" : "IdRef", "name" : "'Vector 1'" },
{ "kind" : "IdRef", "name" : "'Vector 2'" },
{ "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" }
],
"capabilities" : [ "DotProduct" ],
"version" : "1.6"
},
{
"opname" : "OpSDotKHR",
"class" : "Arithmetic",
@@ -4272,7 +4302,22 @@
{ "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" }
],
"capabilities" : [ "DotProductKHR" ],
"version" : "None"
"extensions" : [ "SPV_KHR_integer_dot_product" ],
"version" : "1.6"
},
{
"opname" : "OpUDot",
"class" : "Arithmetic",
"opcode" : 4451,
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
{ "kind" : "IdRef", "name" : "'Vector 1'" },
{ "kind" : "IdRef", "name" : "'Vector 2'" },
{ "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" }
],
"capabilities" : [ "DotProduct" ],
"version" : "1.6"
},
{
"opname" : "OpUDotKHR",
@@ -4286,7 +4331,22 @@
{ "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" }
],
"capabilities" : [ "DotProductKHR" ],
"version" : "None"
"extensions" : [ "SPV_KHR_integer_dot_product" ],
"version" : "1.6"
},
{
"opname" : "OpSUDot",
"class" : "Arithmetic",
"opcode" : 4452,
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
{ "kind" : "IdRef", "name" : "'Vector 1'" },
{ "kind" : "IdRef", "name" : "'Vector 2'" },
{ "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" }
],
"capabilities" : [ "DotProduct" ],
"version" : "1.6"
},
{
"opname" : "OpSUDotKHR",
@@ -4300,7 +4360,23 @@
{ "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" }
],
"capabilities" : [ "DotProductKHR" ],
"version" : "None"
"extensions" : [ "SPV_KHR_integer_dot_product" ],
"version" : "1.6"
},
{
"opname" : "OpSDotAccSat",
"class" : "Arithmetic",
"opcode" : 4453,
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
{ "kind" : "IdRef", "name" : "'Vector 1'" },
{ "kind" : "IdRef", "name" : "'Vector 2'" },
{ "kind" : "IdRef", "name" : "'Accumulator'" },
{ "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" }
],
"capabilities" : [ "DotProduct" ],
"version" : "1.6"
},
{
"opname" : "OpSDotAccSatKHR",
@@ -4315,7 +4391,23 @@
{ "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" }
],
"capabilities" : [ "DotProductKHR" ],
"version" : "None"
"extensions" : [ "SPV_KHR_integer_dot_product" ],
"version" : "1.6"
},
{
"opname" : "OpUDotAccSat",
"class" : "Arithmetic",
"opcode" : 4454,
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
{ "kind" : "IdRef", "name" : "'Vector 1'" },
{ "kind" : "IdRef", "name" : "'Vector 2'" },
{ "kind" : "IdRef", "name" : "'Accumulator'" },
{ "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" }
],
"capabilities" : [ "DotProduct" ],
"version" : "1.6"
},
{
"opname" : "OpUDotAccSatKHR",
@@ -4330,7 +4422,23 @@
{ "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" }
],
"capabilities" : [ "DotProductKHR" ],
"version" : "None"
"extensions" : [ "SPV_KHR_integer_dot_product" ],
"version" : "1.6"
},
{
"opname" : "OpSUDotAccSat",
"class" : "Arithmetic",
"opcode" : 4455,
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
{ "kind" : "IdRef", "name" : "'Vector 1'" },
{ "kind" : "IdRef", "name" : "'Vector 2'" },
{ "kind" : "IdRef", "name" : "'Accumulator'" },
{ "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" }
],
"capabilities" : [ "DotProduct" ],
"version" : "1.6"
},
{
"opname" : "OpSUDotAccSatKHR",
@@ -4345,7 +4453,8 @@
{ "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" }
],
"capabilities" : [ "DotProductKHR" ],
"version" : "None"
"extensions" : [ "SPV_KHR_integer_dot_product" ],
"version" : "1.6"
},
{
"opname" : "OpTypeRayQueryKHR",
@@ -4924,13 +5033,19 @@
"extensions" : [ "SPV_EXT_fragment_shader_interlock" ],
"version" : "None"
},
{
"opname" : "OpDemoteToHelperInvocation",
"class" : "Control-Flow",
"opcode" : 5380,
"capabilities" : [ "DemoteToHelperInvocation" ],
"version" : "1.6"
},
{
"opname" : "OpDemoteToHelperInvocationEXT",
"class" : "Reserved",
"class" : "Control-Flow",
"opcode" : 5380,
"capabilities" : [ "DemoteToHelperInvocationEXT" ],
"extensions" : [ "SPV_EXT_demote_to_helper_invocation" ],
"version" : "None"
"version" : "1.6"
},
{
"opname" : "OpIsHelperInvocationEXT",
@@ -7769,6 +7884,43 @@
"extensions" : [ "SPV_INTEL_unstructured_loop_controls" ],
"version" : "None"
},
{
"opname" : "OpAliasDomainDeclINTEL",
"class" : "@exclude",
"opcode" : 5911,
"operands" : [
{ "kind" : "IdResult"},
{ "kind" : "IdRef", "quantifier" : "?", "name" : "'Name'" }
],
"capabilities" : [ "MemoryAccessAliasingINTEL" ],
"extensions" : [ "SPV_INTEL_memory_access_aliasing" ],
"version" : "None"
},
{
"opname" : "OpAliasScopeDeclINTEL",
"class" : "@exclude",
"opcode" : 5912,
"operands" : [
{ "kind" : "IdResult"},
{ "kind" : "IdRef", "name" : "'Alias Domain'"},
{ "kind" : "IdRef", "quantifier" : "?", "name" : "'Name'" }
],
"capabilities" : [ "MemoryAccessAliasingINTEL" ],
"extensions" : [ "SPV_INTEL_memory_access_aliasing" ],
"version" : "None"
},
{
"opname" : "OpAliasScopeListDeclINTEL",
"class" : "@exclude",
"opcode" : 5913,
"operands" : [
{ "kind" : "IdResult"},
{ "kind" : "IdRef", "quantifier" : "*", "name" : "'AliasScope1, AliasScope2, ...'" }
],
"capabilities" : [ "MemoryAccessAliasingINTEL" ],
"extensions" : [ "SPV_INTEL_memory_access_aliasing" ],
"version" : "None"
},
{
"opname" : "OpFixedSqrtINTEL",
"class" : "@exclude",
@@ -8412,6 +8564,142 @@
],
"capabilities" : [ "LongConstantCompositeINTEL" ],
"version" : "None"
},
{
"opname" : "OpControlBarrierArriveINTEL",
"class" : "Barrier",
"opcode" : 6142,
"operands" : [
{ "kind" : "IdScope", "name" : "'Execution'" },
{ "kind" : "IdScope", "name" : "'Memory'" },
{ "kind" : "IdMemorySemantics", "name" : "'Semantics'" }
],
"capabilities" : [ "SplitBarrierINTEL" ],
"version" : "None"
},
{
"opname" : "OpControlBarrierWaitINTEL",
"class" : "Barrier",
"opcode" : 6143,
"operands" : [
{ "kind" : "IdScope", "name" : "'Execution'" },
{ "kind" : "IdScope", "name" : "'Memory'" },
{ "kind" : "IdMemorySemantics", "name" : "'Semantics'" }
],
"capabilities" : [ "SplitBarrierINTEL" ],
"version" : "None"
},
{
"opname" : "OpGroupIMulKHR",
"class" : "Group",
"opcode" : 6401,
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
{ "kind" : "IdScope", "name" : "'Execution'" },
{ "kind" : "GroupOperation", "name" : "'Operation'" },
{ "kind" : "IdRef", "name" : "'X'" }
],
"capabilities" : [ "GroupUniformArithmeticKHR" ],
"version" : "None"
},
{
"opname" : "OpGroupFMulKHR",
"class" : "Group",
"opcode" : 6402,
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
{ "kind" : "IdScope", "name" : "'Execution'" },
{ "kind" : "GroupOperation", "name" : "'Operation'" },
{ "kind" : "IdRef", "name" : "'X'" }
],
"capabilities" : [ "GroupUniformArithmeticKHR" ],
"version" : "None"
},
{
"opname" : "OpGroupBitwiseAndKHR",
"class" : "Group",
"opcode" : 6403,
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
{ "kind" : "IdScope", "name" : "'Execution'" },
{ "kind" : "GroupOperation", "name" : "'Operation'" },
{ "kind" : "IdRef", "name" : "'X'" }
],
"capabilities" : [ "GroupUniformArithmeticKHR" ],
"version" : "None"
},
{
"opname" : "OpGroupBitwiseOrKHR",
"class" : "Group",
"opcode" : 6404,
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
{ "kind" : "IdScope", "name" : "'Execution'" },
{ "kind" : "GroupOperation", "name" : "'Operation'" },
{ "kind" : "IdRef", "name" : "'X'" }
],
"capabilities" : [ "GroupUniformArithmeticKHR" ],
"version" : "None"
},
{
"opname" : "OpGroupBitwiseXorKHR",
"class" : "Group",
"opcode" : 6405,
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
{ "kind" : "IdScope", "name" : "'Execution'" },
{ "kind" : "GroupOperation", "name" : "'Operation'" },
{ "kind" : "IdRef", "name" : "'X'" }
],
"capabilities" : [ "GroupUniformArithmeticKHR" ],
"version" : "None"
},
{
"opname" : "OpGroupLogicalAndKHR",
"class" : "Group",
"opcode" : 6406,
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
{ "kind" : "IdScope", "name" : "'Execution'" },
{ "kind" : "GroupOperation", "name" : "'Operation'" },
{ "kind" : "IdRef", "name" : "'X'" }
],
"capabilities" : [ "GroupUniformArithmeticKHR" ],
"version" : "None"
},
{
"opname" : "OpGroupLogicalOrKHR",
"class" : "Group",
"opcode" : 6407,
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
{ "kind" : "IdScope", "name" : "'Execution'" },
{ "kind" : "GroupOperation", "name" : "'Operation'" },
{ "kind" : "IdRef", "name" : "'X'" }
],
"capabilities" : [ "GroupUniformArithmeticKHR" ],
"version" : "None"
},
{
"opname" : "OpGroupLogicalXorKHR",
"class" : "Group",
"opcode" : 6408,
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
{ "kind" : "IdScope", "name" : "'Execution'" },
{ "kind" : "GroupOperation", "name" : "'Operation'" },
{ "kind" : "IdRef", "name" : "'X'" }
],
"capabilities" : [ "GroupUniformArithmeticKHR" ],
"version" : "None"
}
],
"operand_kinds" : [
@@ -8558,6 +8846,11 @@
"value" : "0x2000",
"version" : "1.4"
},
{
"enumerant" : "Nontemporal",
"value" : "0x4000",
"version" : "1.6"
},
{
"enumerant" : "Offsets",
"value" : "0x10000",
@@ -8985,6 +9278,26 @@
"capabilities" : [ "VulkanMemoryModel" ],
"extensions" : [ "SPV_KHR_vulkan_memory_model" ],
"version" : "1.5"
},
{
"enumerant" : "AliasScopeINTELMask",
"value" : "0x10000",
"parameters" : [
{ "kind" : "IdRef" }
],
"capabilities" : [ "MemoryAccessAliasingINTEL" ],
"extensions" : [ "SPV_INTEL_memory_access_aliasing" ],
"version" : "None"
},
{
"enumerant" : "NoAliasINTELMask",
"parameters" : [
{ "kind" : "IdRef" }
],
"value" : "0x20000",
"capabilities" : [ "MemoryAccessAliasingINTEL" ],
"extensions" : [ "SPV_INTEL_memory_access_aliasing" ],
"version" : "None"
}
]
},
@@ -9136,6 +9449,10 @@
{
"enumerant" : "CPP_for_OpenCL",
"value" : 6
},
{
"enumerant" : "SYCL",
"value" : 7
}
]
},
@@ -9812,6 +10129,15 @@
],
"capabilities" : [ "FPGAKernelAttributesINTEL" ],
"version" : "None"
},
{
"enumerant" : "NamedBarrierCountINTEL",
"value" : 6417,
"parameters" : [
{ "kind" : "LiteralInteger", "name" : "'Barrier Count'" }
],
"capabilities" : [ "VectorComputeINTEL" ],
"version" : "None"
}
]
},
@@ -10877,12 +11203,12 @@
{
"enumerant" : "Uniform",
"value" : 26,
"capabilities" : [ "Shader" ]
"capabilities" : [ "Shader", "UniformDecoration" ]
},
{
"enumerant" : "UniformId",
"value" : 27,
"capabilities" : [ "Shader" ],
"capabilities" : [ "Shader", "UniformDecoration" ],
"parameters" : [
{ "kind" : "IdScope", "name" : "'Execution'" }
],
@@ -11114,11 +11440,18 @@
"extensions" : [ "SPV_NV_mesh_shader" ],
"version" : "None"
},
{
"enumerant" : "PerVertexKHR",
"value" : 5285,
"capabilities" : [ "FragmentBarycentricNV", "FragmentBarycentricKHR" ],
"extensions" : [ "SPV_NV_fragment_shader_barycentric", "SPV_KHR_fragment_shader_barycentric" ],
"version" : "None"
},
{
"enumerant" : "PerVertexNV",
"value" : 5285,
"capabilities" : [ "FragmentBarycentricNV" ],
"extensions" : [ "SPV_NV_fragment_shader_barycentric" ],
"capabilities" : [ "FragmentBarycentricNV", "FragmentBarycentricKHR" ],
"extensions" : [ "SPV_NV_fragment_shader_barycentric", "SPV_KHR_fragment_shader_barycentric" ],
"version" : "None"
},
{
@@ -11467,6 +11800,24 @@
"capabilities" : [ "LoopFuseINTEL" ],
"version" : "None"
},
{
"enumerant" : "AliasScopeINTEL",
"value" : 5914,
"parameters" : [
{ "kind" : "IdRef", "name" : "'Aliasing Scopes List'" }
],
"capabilities" : [ "MemoryAccessAliasingINTEL" ],
"version" : "None"
},
{
"enumerant" : "NoAliasINTEL",
"value" : 5915,
"parameters" : [
{ "kind" : "IdRef", "name" : "'Aliasing Scopes List'" }
],
"capabilities" : [ "MemoryAccessAliasingINTEL" ],
"version" : "None"
},
{
"enumerant" : "BufferLocationINTEL",
"value" : 5921,
@@ -11506,6 +11857,12 @@
"value" : 6087,
"capabilities" : [ "VectorComputeINTEL" ],
"version" : "None"
},
{
"enumerant" : "MediaBlockIOINTEL",
"value" : 6140,
"capabilities" : [ "VectorComputeINTEL" ],
"version" : "None"
}
]
},
@@ -11973,18 +12330,32 @@
"extensions" : [ "SPV_NV_mesh_shader" ],
"version" : "None"
},
{
"enumerant" : "BaryCoordKHR",
"value" : 5286,
"capabilities" : [ "FragmentBarycentricNV", "FragmentBarycentricKHR" ],
"extensions" : [ "SPV_NV_fragment_shader_barycentric", "SPV_KHR_fragment_shader_barycentric" ],
"version" : "None"
},
{
"enumerant" : "BaryCoordNV",
"value" : 5286,
"capabilities" : [ "FragmentBarycentricNV" ],
"extensions" : [ "SPV_NV_fragment_shader_barycentric" ],
"capabilities" : [ "FragmentBarycentricNV", "FragmentBarycentricKHR" ],
"extensions" : [ "SPV_NV_fragment_shader_barycentric", "SPV_KHR_fragment_shader_barycentric" ],
"version" : "None"
},
{
"enumerant" : "BaryCoordNoPerspKHR",
"value" : 5287,
"capabilities" : [ "FragmentBarycentricNV", "FragmentBarycentricKHR" ],
"extensions" : [ "SPV_NV_fragment_shader_barycentric", "SPV_KHR_fragment_shader_barycentric" ],
"version" : "None"
},
{
"enumerant" : "BaryCoordNoPerspNV",
"value" : 5287,
"capabilities" : [ "FragmentBarycentricNV" ],
"extensions" : [ "SPV_NV_fragment_shader_barycentric" ],
"capabilities" : [ "FragmentBarycentricNV", "FragmentBarycentricKHR" ],
"extensions" : [ "SPV_NV_fragment_shader_barycentric", "SPV_KHR_fragment_shader_barycentric" ],
"version" : "None"
},
{
@@ -12245,6 +12616,13 @@
"capabilities" : [ "ShaderSMBuiltinsNV" ],
"extensions" : [ "SPV_NV_shader_sm_builtins" ],
"version" : "None"
},
{
"enumerant" : "CullMaskKHR",
"value" : 6021,
"capabilities" : [ "RayCullMaskKHR" ],
"extensions" : [ "SPV_KHR_ray_cull_mask" ],
"version" : "None"
}
]
},
@@ -12709,6 +13087,11 @@
"value" : 70,
"version" : "1.5"
},
{
"enumerant" : "UniformDecoration",
"value" : 71,
"version" : "1.6"
},
{
"enumerant" : "FragmentShadingRateKHR",
"value" : 4422,
@@ -13034,10 +13417,16 @@
"extensions" : [ "SPV_NV_shader_image_footprint" ],
"version" : "None"
},
{
"enumerant" : "FragmentBarycentricKHR",
"value" : 5284,
"extensions" : [ "SPV_NV_fragment_shader_barycentric", "SPV_KHR_fragment_shader_barycentric" ],
"version" : "None"
},
{
"enumerant" : "FragmentBarycentricNV",
"value" : 5284,
"extensions" : [ "SPV_NV_fragment_shader_barycentric" ],
"extensions" : [ "SPV_NV_fragment_shader_barycentric", "SPV_KHR_fragment_shader_barycentric" ],
"version" : "None"
},
{
@@ -13320,12 +13709,18 @@
"extensions" : [ "SPV_EXT_fragment_shader_interlock" ],
"version" : "None"
},
{
"enumerant" : "DemoteToHelperInvocation",
"value" : 5379,
"capabilities" : [ "Shader" ],
"version" : "1.6"
},
{
"enumerant" : "DemoteToHelperInvocationEXT",
"value" : 5379,
"capabilities" : [ "Shader" ],
"extensions" : [ "SPV_EXT_demote_to_helper_invocation" ],
"version" : "None"
"version" : "1.6"
},
{
"enumerant" : "BindlessTextureNV",
@@ -13528,6 +13923,12 @@
"extensions" : [ "SPV_INTEL_loop_fuse" ],
"version" : "None"
},
{
"enumerant" : "MemoryAccessAliasingINTEL",
"value" : 5910,
"extensions" : [ "SPV_INTEL_memory_access_aliasing" ],
"version" : "None"
},
{
"enumerant" : "FPGABufferLocationINTEL",
"value" : 5920,
@@ -13564,29 +13965,56 @@
"extensions" : [ "SPV_INTEL_fpga_reg" ],
"version" : "None"
},
{
"enumerant" : "DotProductInputAll",
"value" : 6016,
"version" : "1.6"
},
{
"enumerant" : "DotProductInputAllKHR",
"value" : 6016,
"extensions" : [ "SPV_KHR_integer_dot_product" ],
"version" : "None"
"version" : "1.6"
},
{
"enumerant" : "DotProductInput4x8Bit",
"value" : 6017,
"capabilities" : [ "Int8" ],
"version" : "1.6"
},
{
"enumerant" : "DotProductInput4x8BitKHR",
"value" : 6017,
"capabilities" : [ "Int8" ],
"extensions" : [ "SPV_KHR_integer_dot_product" ],
"version" : "None"
"version" : "1.6"
},
{
"enumerant" : "DotProductInput4x8BitPacked",
"value" : 6018,
"version" : "1.6"
},
{
"enumerant" : "DotProductInput4x8BitPackedKHR",
"value" : 6018,
"extensions" : [ "SPV_KHR_integer_dot_product" ],
"version" : "None"
"version" : "1.6"
},
{
"enumerant" : "DotProduct",
"value" : 6019,
"version" : "1.6"
},
{
"enumerant" : "DotProductKHR",
"value" : 6019,
"extensions" : [ "SPV_KHR_integer_dot_product" ],
"version" : "1.6"
},
{
"enumerant" : "RayCullMaskKHR",
"value" : 6020,
"extensions" : [ "SPV_KHR_ray_cull_mask" ],
"version" : "None"
},
{
@@ -13595,17 +14023,22 @@
"extensions" : [ "SPV_KHR_bit_instructions" ],
"version" : "None"
},
{
"enumerant" : "GroupNonUniformRotateKHR",
"value" : 6026,
"capabilities" : [ "GroupNonUniform" ],
"extensions" : [ "SPV_KHR_subgroup_rotate" ],
"version" : "None"
},
{
"enumerant" : "AtomicFloat32AddEXT",
"value" : 6033,
"capabilities" : [ "Shader" ],
"extensions" : [ "SPV_EXT_shader_atomic_float_add" ],
"version" : "None"
},
{
"enumerant" : "AtomicFloat64AddEXT",
"value" : 6034,
"capabilities" : [ "Shader" ],
"extensions" : [ "SPV_EXT_shader_atomic_float_add" ],
"version" : "None"
},
@@ -13624,7 +14057,6 @@
{
"enumerant" : "AtomicFloat16AddEXT",
"value" : 6095,
"capabilities" : [ "Shader" ],
"extensions" : [ "SPV_EXT_shader_atomic_float16_add" ],
"version" : "None"
},
@@ -13633,6 +14065,18 @@
"value" : 6114,
"extensions" : [ "SPV_INTEL_debug_module" ],
"version" : "None"
},
{
"enumerant" : "SplitBarrierINTEL",
"value" : 6141,
"extensions" : [ "SPV_INTEL_split_barrier" ],
"version" : "None"
},
{
"enumerant" : "GroupUniformArithmeticKHR",
"value" : 6400,
"extensions" : [ "SPV_KHR_uniform_group_instructions"],
"version" : "None"
}
]
},
@@ -13700,11 +14144,16 @@
"category" : "ValueEnum",
"kind" : "PackedVectorFormat",
"enumerants" : [
{
"enumerant" : "PackedVectorFormat4x8Bit",
"value" : 0,
"version" : "1.6"
},
{
"enumerant" : "PackedVectorFormat4x8BitKHR",
"value" : 0,
"extensions" : [ "SPV_KHR_integer_dot_product" ],
"version" : "None"
"version" : "1.6"
}
]
},
@@ -26,7 +26,7 @@
// the Binary Section of the SPIR-V specification.
// Enumeration tokens for SPIR-V, in various styles:
// C, C++, C++11, JSON, Lua, Python, C#, D
// C, C++, C++11, JSON, Lua, Python, C#, D, Beef
//
// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL
// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL
@@ -36,6 +36,8 @@
// - C# will use enum classes in the Specification class located in the "Spv" namespace,
// e.g.: Spv.Specification.SourceLanguage.GLSL
// - D will have tokens under the "spv" module, e.g: spv.SourceLanguage.GLSL
// - Beef will use enum classes in the Specification class located in the "Spv" namespace,
// e.g.: Spv.Specification.SourceLanguage.GLSL
//
// Some tokens act like mask values, which can be OR'd together,
// while others are mutually exclusive. The mask-like ones have
@@ -48,8 +50,8 @@ namespace Spv
public static class Specification
{
public const uint MagicNumber = 0x07230203;
public const uint Version = 0x00010500;
public const uint Revision = 4;
public const uint Version = 0x00010600;
public const uint Revision = 1;
public const uint OpCodeMask = 0xffff;
public const uint WordCountShift = 16;
@@ -62,6 +64,7 @@ namespace Spv
OpenCL_CPP = 4,
HLSL = 5,
CPP_for_OpenCL = 6,
SYCL = 7,
}
public enum ExecutionModel
@@ -176,6 +179,7 @@ namespace Spv
NoGlobalOffsetINTEL = 5895,
NumSIMDWorkitemsINTEL = 5896,
SchedulerTargetFmaxMhzINTEL = 5903,
NamedBarrierCountINTEL = 6417,
}
public enum StorageClass
@@ -349,6 +353,7 @@ namespace Spv
VolatileTexelKHR = 11,
SignExtend = 12,
ZeroExtend = 13,
Nontemporal = 14,
Offsets = 16,
}
@@ -373,6 +378,7 @@ namespace Spv
VolatileTexelKHR = 0x00000800,
SignExtend = 0x00001000,
ZeroExtend = 0x00002000,
Nontemporal = 0x00004000,
Offsets = 0x00010000,
}
@@ -492,6 +498,7 @@ namespace Spv
PerPrimitiveNV = 5271,
PerViewNV = 5272,
PerTaskNV = 5273,
PerVertexKHR = 5285,
PerVertexNV = 5285,
NonUniform = 5300,
NonUniformEXT = 5300,
@@ -537,11 +544,14 @@ namespace Spv
PrefetchINTEL = 5902,
StallEnableINTEL = 5905,
FuseLoopsInFunctionINTEL = 5907,
AliasScopeINTEL = 5914,
NoAliasINTEL = 5915,
BufferLocationINTEL = 5921,
IOPipeStorageINTEL = 5944,
FunctionFloatingPointModeINTEL = 6080,
SingleElementVectorINTEL = 6085,
VectorComputeCallableFunctionINTEL = 6087,
MediaBlockIOINTEL = 6140,
}
public enum BuiltIn
@@ -626,7 +636,9 @@ namespace Spv
LayerPerViewNV = 5279,
MeshViewCountNV = 5280,
MeshViewIndicesNV = 5281,
BaryCoordKHR = 5286,
BaryCoordNV = 5286,
BaryCoordNoPerspKHR = 5287,
BaryCoordNoPerspNV = 5287,
FragSizeEXT = 5292,
FragmentSizeNV = 5292,
@@ -665,6 +677,7 @@ namespace Spv
SMCountNV = 5375,
WarpIDNV = 5376,
SMIDNV = 5377,
CullMaskKHR = 6021,
}
public enum SelectionControlShift
@@ -796,6 +809,8 @@ namespace Spv
MakePointerVisibleKHR = 4,
NonPrivatePointer = 5,
NonPrivatePointerKHR = 5,
AliasScopeINTELMask = 16,
NoAliasINTELMask = 17,
}
public enum MemoryAccessMask
@@ -810,6 +825,8 @@ namespace Spv
MakePointerVisibleKHR = 0x00000010,
NonPrivatePointer = 0x00000020,
NonPrivatePointerKHR = 0x00000020,
AliasScopeINTELMask = 0x00010000,
NoAliasINTELMask = 0x00020000,
}
public enum Scope
@@ -924,6 +941,7 @@ namespace Spv
GroupNonUniformQuad = 68,
ShaderLayer = 69,
ShaderViewportIndex = 70,
UniformDecoration = 71,
FragmentShadingRateKHR = 4422,
SubgroupBallotKHR = 4423,
DrawParameters = 4427,
@@ -972,6 +990,7 @@ namespace Spv
FragmentFullyCoveredEXT = 5265,
MeshShadingNV = 5266,
ImageFootprintNV = 5282,
FragmentBarycentricKHR = 5284,
FragmentBarycentricNV = 5284,
ComputeDerivativeGroupQuadsNV = 5288,
FragmentDensityEXT = 5291,
@@ -1016,6 +1035,7 @@ namespace Spv
FragmentShaderShadingRateInterlockEXT = 5372,
ShaderSMBuiltinsNV = 5373,
FragmentShaderPixelInterlockEXT = 5378,
DemoteToHelperInvocation = 5379,
DemoteToHelperInvocationEXT = 5379,
BindlessTextureNV = 5390,
SubgroupShuffleINTEL = 5568,
@@ -1050,23 +1070,32 @@ namespace Spv
FPGAMemoryAccessesINTEL = 5898,
FPGAClusterAttributesINTEL = 5904,
LoopFuseINTEL = 5906,
MemoryAccessAliasingINTEL = 5910,
FPGABufferLocationINTEL = 5920,
ArbitraryPrecisionFixedPointINTEL = 5922,
USMStorageClassesINTEL = 5935,
IOPipesINTEL = 5943,
BlockingPipesINTEL = 5945,
FPGARegINTEL = 5948,
DotProductInputAll = 6016,
DotProductInputAllKHR = 6016,
DotProductInput4x8Bit = 6017,
DotProductInput4x8BitKHR = 6017,
DotProductInput4x8BitPacked = 6018,
DotProductInput4x8BitPackedKHR = 6018,
DotProduct = 6019,
DotProductKHR = 6019,
RayCullMaskKHR = 6020,
BitInstructions = 6025,
GroupNonUniformRotateKHR = 6026,
AtomicFloat32AddEXT = 6033,
AtomicFloat64AddEXT = 6034,
LongConstantCompositeINTEL = 6089,
OptNoneINTEL = 6094,
AtomicFloat16AddEXT = 6095,
DebugInfoModuleINTEL = 6114,
SplitBarrierINTEL = 6141,
GroupUniformArithmeticKHR = 6400,
}
public enum RayFlagsShift
@@ -1168,6 +1197,7 @@ namespace Spv
public enum PackedVectorFormat
{
PackedVectorFormat4x8Bit = 0,
PackedVectorFormat4x8BitKHR = 0,
}
@@ -1523,17 +1553,24 @@ namespace Spv
OpSubgroupAllKHR = 4428,
OpSubgroupAnyKHR = 4429,
OpSubgroupAllEqualKHR = 4430,
OpGroupNonUniformRotateKHR = 4431,
OpSubgroupReadInvocationKHR = 4432,
OpTraceRayKHR = 4445,
OpExecuteCallableKHR = 4446,
OpConvertUToAccelerationStructureKHR = 4447,
OpIgnoreIntersectionKHR = 4448,
OpTerminateRayKHR = 4449,
OpSDot = 4450,
OpSDotKHR = 4450,
OpUDot = 4451,
OpUDotKHR = 4451,
OpSUDot = 4452,
OpSUDotKHR = 4452,
OpSDotAccSat = 4453,
OpSDotAccSatKHR = 4453,
OpUDotAccSat = 4454,
OpUDotAccSatKHR = 4454,
OpSUDotAccSat = 4455,
OpSUDotAccSatKHR = 4455,
OpTypeRayQueryKHR = 4472,
OpRayQueryInitializeKHR = 4473,
@@ -1573,6 +1610,7 @@ namespace Spv
OpCooperativeMatrixLengthNV = 5362,
OpBeginInvocationInterlockEXT = 5364,
OpEndInvocationInterlockEXT = 5365,
OpDemoteToHelperInvocation = 5380,
OpDemoteToHelperInvocationEXT = 5380,
OpIsHelperInvocationEXT = 5381,
OpConvertUToImageNV = 5391,
@@ -1782,6 +1820,9 @@ namespace Spv
OpArbitraryFloatPowRINTEL = 5881,
OpArbitraryFloatPowNINTEL = 5882,
OpLoopControlINTEL = 5887,
OpAliasDomainDeclINTEL = 5911,
OpAliasScopeDeclINTEL = 5912,
OpAliasScopeListDeclINTEL = 5913,
OpFixedSqrtINTEL = 5923,
OpFixedRecipINTEL = 5924,
OpFixedRsqrtINTEL = 5925,
@@ -1820,6 +1861,16 @@ namespace Spv
OpTypeStructContinuedINTEL = 6090,
OpConstantCompositeContinuedINTEL = 6091,
OpSpecConstantCompositeContinuedINTEL = 6092,
OpControlBarrierArriveINTEL = 6142,
OpControlBarrierWaitINTEL = 6143,
OpGroupIMulKHR = 6401,
OpGroupFMulKHR = 6402,
OpGroupBitwiseAndKHR = 6403,
OpGroupBitwiseOrKHR = 6404,
OpGroupBitwiseXorKHR = 6405,
OpGroupLogicalAndKHR = 6406,
OpGroupLogicalOrKHR = 6407,
OpGroupLogicalXorKHR = 6408,
}
}
}
@@ -31,7 +31,7 @@
/*
** Enumeration tokens for SPIR-V, in various styles:
** C, C++, C++11, JSON, Lua, Python, C#, D
** C, C++, C++11, JSON, Lua, Python, C#, D, Beef
**
** - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL
** - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL
@@ -41,6 +41,8 @@
** - C# will use enum classes in the Specification class located in the "Spv" namespace,
** e.g.: Spv.Specification.SourceLanguage.GLSL
** - D will have tokens under the "spv" module, e.g: spv.SourceLanguage.GLSL
** - Beef will use enum classes in the Specification class located in the "Spv" namespace,
** e.g.: Spv.Specification.SourceLanguage.GLSL
**
** Some tokens act like mask values, which can be OR'd together,
** while others are mutually exclusive. The mask-like ones have
@@ -53,12 +55,12 @@
typedef unsigned int SpvId;
#define SPV_VERSION 0x10500
#define SPV_REVISION 4
#define SPV_VERSION 0x10600
#define SPV_REVISION 1
static const unsigned int SpvMagicNumber = 0x07230203;
static const unsigned int SpvVersion = 0x00010500;
static const unsigned int SpvRevision = 4;
static const unsigned int SpvVersion = 0x00010600;
static const unsigned int SpvRevision = 1;
static const unsigned int SpvOpCodeMask = 0xffff;
static const unsigned int SpvWordCountShift = 16;
@@ -70,6 +72,7 @@ typedef enum SpvSourceLanguage_ {
SpvSourceLanguageOpenCL_CPP = 4,
SpvSourceLanguageHLSL = 5,
SpvSourceLanguageCPP_for_OpenCL = 6,
SpvSourceLanguageSYCL = 7,
SpvSourceLanguageMax = 0x7fffffff,
} SpvSourceLanguage;
@@ -184,6 +187,7 @@ typedef enum SpvExecutionMode_ {
SpvExecutionModeNoGlobalOffsetINTEL = 5895,
SpvExecutionModeNumSIMDWorkitemsINTEL = 5896,
SpvExecutionModeSchedulerTargetFmaxMhzINTEL = 5903,
SpvExecutionModeNamedBarrierCountINTEL = 6417,
SpvExecutionModeMax = 0x7fffffff,
} SpvExecutionMode;
@@ -357,6 +361,7 @@ typedef enum SpvImageOperandsShift_ {
SpvImageOperandsVolatileTexelKHRShift = 11,
SpvImageOperandsSignExtendShift = 12,
SpvImageOperandsZeroExtendShift = 13,
SpvImageOperandsNontemporalShift = 14,
SpvImageOperandsOffsetsShift = 16,
SpvImageOperandsMax = 0x7fffffff,
} SpvImageOperandsShift;
@@ -381,6 +386,7 @@ typedef enum SpvImageOperandsMask_ {
SpvImageOperandsVolatileTexelKHRMask = 0x00000800,
SpvImageOperandsSignExtendMask = 0x00001000,
SpvImageOperandsZeroExtendMask = 0x00002000,
SpvImageOperandsNontemporalMask = 0x00004000,
SpvImageOperandsOffsetsMask = 0x00010000,
} SpvImageOperandsMask;
@@ -498,6 +504,7 @@ typedef enum SpvDecoration_ {
SpvDecorationPerPrimitiveNV = 5271,
SpvDecorationPerViewNV = 5272,
SpvDecorationPerTaskNV = 5273,
SpvDecorationPerVertexKHR = 5285,
SpvDecorationPerVertexNV = 5285,
SpvDecorationNonUniform = 5300,
SpvDecorationNonUniformEXT = 5300,
@@ -543,11 +550,14 @@ typedef enum SpvDecoration_ {
SpvDecorationPrefetchINTEL = 5902,
SpvDecorationStallEnableINTEL = 5905,
SpvDecorationFuseLoopsInFunctionINTEL = 5907,
SpvDecorationAliasScopeINTEL = 5914,
SpvDecorationNoAliasINTEL = 5915,
SpvDecorationBufferLocationINTEL = 5921,
SpvDecorationIOPipeStorageINTEL = 5944,
SpvDecorationFunctionFloatingPointModeINTEL = 6080,
SpvDecorationSingleElementVectorINTEL = 6085,
SpvDecorationVectorComputeCallableFunctionINTEL = 6087,
SpvDecorationMediaBlockIOINTEL = 6140,
SpvDecorationMax = 0x7fffffff,
} SpvDecoration;
@@ -632,7 +642,9 @@ typedef enum SpvBuiltIn_ {
SpvBuiltInLayerPerViewNV = 5279,
SpvBuiltInMeshViewCountNV = 5280,
SpvBuiltInMeshViewIndicesNV = 5281,
SpvBuiltInBaryCoordKHR = 5286,
SpvBuiltInBaryCoordNV = 5286,
SpvBuiltInBaryCoordNoPerspKHR = 5287,
SpvBuiltInBaryCoordNoPerspNV = 5287,
SpvBuiltInFragSizeEXT = 5292,
SpvBuiltInFragmentSizeNV = 5292,
@@ -671,6 +683,7 @@ typedef enum SpvBuiltIn_ {
SpvBuiltInSMCountNV = 5375,
SpvBuiltInWarpIDNV = 5376,
SpvBuiltInSMIDNV = 5377,
SpvBuiltInCullMaskKHR = 6021,
SpvBuiltInMax = 0x7fffffff,
} SpvBuiltIn;
@@ -798,6 +811,8 @@ typedef enum SpvMemoryAccessShift_ {
SpvMemoryAccessMakePointerVisibleKHRShift = 4,
SpvMemoryAccessNonPrivatePointerShift = 5,
SpvMemoryAccessNonPrivatePointerKHRShift = 5,
SpvMemoryAccessAliasScopeINTELMaskShift = 16,
SpvMemoryAccessNoAliasINTELMaskShift = 17,
SpvMemoryAccessMax = 0x7fffffff,
} SpvMemoryAccessShift;
@@ -812,6 +827,8 @@ typedef enum SpvMemoryAccessMask_ {
SpvMemoryAccessMakePointerVisibleKHRMask = 0x00000010,
SpvMemoryAccessNonPrivatePointerMask = 0x00000020,
SpvMemoryAccessNonPrivatePointerKHRMask = 0x00000020,
SpvMemoryAccessAliasScopeINTELMaskMask = 0x00010000,
SpvMemoryAccessNoAliasINTELMaskMask = 0x00020000,
} SpvMemoryAccessMask;
typedef enum SpvScope_ {
@@ -924,6 +941,7 @@ typedef enum SpvCapability_ {
SpvCapabilityGroupNonUniformQuad = 68,
SpvCapabilityShaderLayer = 69,
SpvCapabilityShaderViewportIndex = 70,
SpvCapabilityUniformDecoration = 71,
SpvCapabilityFragmentShadingRateKHR = 4422,
SpvCapabilitySubgroupBallotKHR = 4423,
SpvCapabilityDrawParameters = 4427,
@@ -972,6 +990,7 @@ typedef enum SpvCapability_ {
SpvCapabilityFragmentFullyCoveredEXT = 5265,
SpvCapabilityMeshShadingNV = 5266,
SpvCapabilityImageFootprintNV = 5282,
SpvCapabilityFragmentBarycentricKHR = 5284,
SpvCapabilityFragmentBarycentricNV = 5284,
SpvCapabilityComputeDerivativeGroupQuadsNV = 5288,
SpvCapabilityFragmentDensityEXT = 5291,
@@ -1016,6 +1035,7 @@ typedef enum SpvCapability_ {
SpvCapabilityFragmentShaderShadingRateInterlockEXT = 5372,
SpvCapabilityShaderSMBuiltinsNV = 5373,
SpvCapabilityFragmentShaderPixelInterlockEXT = 5378,
SpvCapabilityDemoteToHelperInvocation = 5379,
SpvCapabilityDemoteToHelperInvocationEXT = 5379,
SpvCapabilityBindlessTextureNV = 5390,
SpvCapabilitySubgroupShuffleINTEL = 5568,
@@ -1050,23 +1070,32 @@ typedef enum SpvCapability_ {
SpvCapabilityFPGAMemoryAccessesINTEL = 5898,
SpvCapabilityFPGAClusterAttributesINTEL = 5904,
SpvCapabilityLoopFuseINTEL = 5906,
SpvCapabilityMemoryAccessAliasingINTEL = 5910,
SpvCapabilityFPGABufferLocationINTEL = 5920,
SpvCapabilityArbitraryPrecisionFixedPointINTEL = 5922,
SpvCapabilityUSMStorageClassesINTEL = 5935,
SpvCapabilityIOPipesINTEL = 5943,
SpvCapabilityBlockingPipesINTEL = 5945,
SpvCapabilityFPGARegINTEL = 5948,
SpvCapabilityDotProductInputAll = 6016,
SpvCapabilityDotProductInputAllKHR = 6016,
SpvCapabilityDotProductInput4x8Bit = 6017,
SpvCapabilityDotProductInput4x8BitKHR = 6017,
SpvCapabilityDotProductInput4x8BitPacked = 6018,
SpvCapabilityDotProductInput4x8BitPackedKHR = 6018,
SpvCapabilityDotProduct = 6019,
SpvCapabilityDotProductKHR = 6019,
SpvCapabilityRayCullMaskKHR = 6020,
SpvCapabilityBitInstructions = 6025,
SpvCapabilityGroupNonUniformRotateKHR = 6026,
SpvCapabilityAtomicFloat32AddEXT = 6033,
SpvCapabilityAtomicFloat64AddEXT = 6034,
SpvCapabilityLongConstantCompositeINTEL = 6089,
SpvCapabilityOptNoneINTEL = 6094,
SpvCapabilityAtomicFloat16AddEXT = 6095,
SpvCapabilityDebugInfoModuleINTEL = 6114,
SpvCapabilitySplitBarrierINTEL = 6141,
SpvCapabilityGroupUniformArithmeticKHR = 6400,
SpvCapabilityMax = 0x7fffffff,
} SpvCapability;
@@ -1166,6 +1195,7 @@ typedef enum SpvOverflowModes_ {
} SpvOverflowModes;
typedef enum SpvPackedVectorFormat_ {
SpvPackedVectorFormatPackedVectorFormat4x8Bit = 0,
SpvPackedVectorFormatPackedVectorFormat4x8BitKHR = 0,
SpvPackedVectorFormatMax = 0x7fffffff,
} SpvPackedVectorFormat;
@@ -1521,17 +1551,24 @@ typedef enum SpvOp_ {
SpvOpSubgroupAllKHR = 4428,
SpvOpSubgroupAnyKHR = 4429,
SpvOpSubgroupAllEqualKHR = 4430,
SpvOpGroupNonUniformRotateKHR = 4431,
SpvOpSubgroupReadInvocationKHR = 4432,
SpvOpTraceRayKHR = 4445,
SpvOpExecuteCallableKHR = 4446,
SpvOpConvertUToAccelerationStructureKHR = 4447,
SpvOpIgnoreIntersectionKHR = 4448,
SpvOpTerminateRayKHR = 4449,
SpvOpSDot = 4450,
SpvOpSDotKHR = 4450,
SpvOpUDot = 4451,
SpvOpUDotKHR = 4451,
SpvOpSUDot = 4452,
SpvOpSUDotKHR = 4452,
SpvOpSDotAccSat = 4453,
SpvOpSDotAccSatKHR = 4453,
SpvOpUDotAccSat = 4454,
SpvOpUDotAccSatKHR = 4454,
SpvOpSUDotAccSat = 4455,
SpvOpSUDotAccSatKHR = 4455,
SpvOpTypeRayQueryKHR = 4472,
SpvOpRayQueryInitializeKHR = 4473,
@@ -1571,6 +1608,7 @@ typedef enum SpvOp_ {
SpvOpCooperativeMatrixLengthNV = 5362,
SpvOpBeginInvocationInterlockEXT = 5364,
SpvOpEndInvocationInterlockEXT = 5365,
SpvOpDemoteToHelperInvocation = 5380,
SpvOpDemoteToHelperInvocationEXT = 5380,
SpvOpIsHelperInvocationEXT = 5381,
SpvOpConvertUToImageNV = 5391,
@@ -1780,6 +1818,9 @@ typedef enum SpvOp_ {
SpvOpArbitraryFloatPowRINTEL = 5881,
SpvOpArbitraryFloatPowNINTEL = 5882,
SpvOpLoopControlINTEL = 5887,
SpvOpAliasDomainDeclINTEL = 5911,
SpvOpAliasScopeDeclINTEL = 5912,
SpvOpAliasScopeListDeclINTEL = 5913,
SpvOpFixedSqrtINTEL = 5923,
SpvOpFixedRecipINTEL = 5924,
SpvOpFixedRsqrtINTEL = 5925,
@@ -1818,10 +1859,23 @@ typedef enum SpvOp_ {
SpvOpTypeStructContinuedINTEL = 6090,
SpvOpConstantCompositeContinuedINTEL = 6091,
SpvOpSpecConstantCompositeContinuedINTEL = 6092,
SpvOpControlBarrierArriveINTEL = 6142,
SpvOpControlBarrierWaitINTEL = 6143,
SpvOpGroupIMulKHR = 6401,
SpvOpGroupFMulKHR = 6402,
SpvOpGroupBitwiseAndKHR = 6403,
SpvOpGroupBitwiseOrKHR = 6404,
SpvOpGroupBitwiseXorKHR = 6405,
SpvOpGroupLogicalAndKHR = 6406,
SpvOpGroupLogicalOrKHR = 6407,
SpvOpGroupLogicalXorKHR = 6408,
SpvOpMax = 0x7fffffff,
} SpvOp;
#ifdef SPV_ENABLE_UTILITY_CODE
#ifndef __cplusplus
#include <stdbool.h>
#endif
inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultType) {
*hasResult = *hasResultType = false;
switch (opcode) {
@@ -2176,18 +2230,19 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy
case SpvOpSubgroupAllKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpSubgroupAnyKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpSubgroupAllEqualKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpGroupNonUniformRotateKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpSubgroupReadInvocationKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpTraceRayKHR: *hasResult = false; *hasResultType = false; break;
case SpvOpExecuteCallableKHR: *hasResult = false; *hasResultType = false; break;
case SpvOpConvertUToAccelerationStructureKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpIgnoreIntersectionKHR: *hasResult = false; *hasResultType = false; break;
case SpvOpTerminateRayKHR: *hasResult = false; *hasResultType = false; break;
case SpvOpSDotKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpUDotKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpSUDotKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpSDotAccSatKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpUDotAccSatKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpSUDotAccSatKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpSDot: *hasResult = true; *hasResultType = true; break;
case SpvOpUDot: *hasResult = true; *hasResultType = true; break;
case SpvOpSUDot: *hasResult = true; *hasResultType = true; break;
case SpvOpSDotAccSat: *hasResult = true; *hasResultType = true; break;
case SpvOpUDotAccSat: *hasResult = true; *hasResultType = true; break;
case SpvOpSUDotAccSat: *hasResult = true; *hasResultType = true; break;
case SpvOpTypeRayQueryKHR: *hasResult = true; *hasResultType = false; break;
case SpvOpRayQueryInitializeKHR: *hasResult = false; *hasResultType = false; break;
case SpvOpRayQueryTerminateKHR: *hasResult = false; *hasResultType = false; break;
@@ -2224,7 +2279,7 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy
case SpvOpCooperativeMatrixLengthNV: *hasResult = true; *hasResultType = true; break;
case SpvOpBeginInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break;
case SpvOpEndInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break;
case SpvOpDemoteToHelperInvocationEXT: *hasResult = false; *hasResultType = false; break;
case SpvOpDemoteToHelperInvocation: *hasResult = false; *hasResultType = false; break;
case SpvOpIsHelperInvocationEXT: *hasResult = true; *hasResultType = true; break;
case SpvOpConvertUToImageNV: *hasResult = true; *hasResultType = true; break;
case SpvOpConvertUToSamplerNV: *hasResult = true; *hasResultType = true; break;
@@ -2431,6 +2486,9 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy
case SpvOpArbitraryFloatPowRINTEL: *hasResult = true; *hasResultType = true; break;
case SpvOpArbitraryFloatPowNINTEL: *hasResult = true; *hasResultType = true; break;
case SpvOpLoopControlINTEL: *hasResult = false; *hasResultType = false; break;
case SpvOpAliasDomainDeclINTEL: *hasResult = true; *hasResultType = false; break;
case SpvOpAliasScopeDeclINTEL: *hasResult = true; *hasResultType = false; break;
case SpvOpAliasScopeListDeclINTEL: *hasResult = true; *hasResultType = false; break;
case SpvOpFixedSqrtINTEL: *hasResult = true; *hasResultType = true; break;
case SpvOpFixedRecipINTEL: *hasResult = true; *hasResultType = true; break;
case SpvOpFixedRsqrtINTEL: *hasResult = true; *hasResultType = true; break;
@@ -2469,6 +2527,16 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy
case SpvOpTypeStructContinuedINTEL: *hasResult = false; *hasResultType = false; break;
case SpvOpConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break;
case SpvOpSpecConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break;
case SpvOpControlBarrierArriveINTEL: *hasResult = false; *hasResultType = false; break;
case SpvOpControlBarrierWaitINTEL: *hasResult = false; *hasResultType = false; break;
case SpvOpGroupIMulKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpGroupFMulKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpGroupBitwiseAndKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpGroupBitwiseOrKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpGroupBitwiseXorKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpGroupLogicalAndKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpGroupLogicalOrKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpGroupLogicalXorKHR: *hasResult = true; *hasResultType = true; break;
}
}
#endif /* SPV_ENABLE_UTILITY_CODE */
@@ -26,7 +26,7 @@
// the Binary Section of the SPIR-V specification.
// Enumeration tokens for SPIR-V, in various styles:
// C, C++, C++11, JSON, Lua, Python, C#, D
// C, C++, C++11, JSON, Lua, Python, C#, D, Beef
//
// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL
// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL
@@ -36,6 +36,8 @@
// - C# will use enum classes in the Specification class located in the "Spv" namespace,
// e.g.: Spv.Specification.SourceLanguage.GLSL
// - D will have tokens under the "spv" module, e.g: spv.SourceLanguage.GLSL
// - Beef will use enum classes in the Specification class located in the "Spv" namespace,
// e.g.: Spv.Specification.SourceLanguage.GLSL
//
// Some tokens act like mask values, which can be OR'd together,
// while others are mutually exclusive. The mask-like ones have
@@ -49,12 +51,12 @@ namespace spv {
typedef unsigned int Id;
#define SPV_VERSION 0x10500
#define SPV_REVISION 4
#define SPV_VERSION 0x10600
#define SPV_REVISION 1
static const unsigned int MagicNumber = 0x07230203;
static const unsigned int Version = 0x00010500;
static const unsigned int Revision = 4;
static const unsigned int Version = 0x00010600;
static const unsigned int Revision = 1;
static const unsigned int OpCodeMask = 0xffff;
static const unsigned int WordCountShift = 16;
@@ -66,6 +68,7 @@ enum SourceLanguage {
SourceLanguageOpenCL_CPP = 4,
SourceLanguageHLSL = 5,
SourceLanguageCPP_for_OpenCL = 6,
SourceLanguageSYCL = 7,
SourceLanguageMax = 0x7fffffff,
};
@@ -180,6 +183,7 @@ enum ExecutionMode {
ExecutionModeNoGlobalOffsetINTEL = 5895,
ExecutionModeNumSIMDWorkitemsINTEL = 5896,
ExecutionModeSchedulerTargetFmaxMhzINTEL = 5903,
ExecutionModeNamedBarrierCountINTEL = 6417,
ExecutionModeMax = 0x7fffffff,
};
@@ -353,6 +357,7 @@ enum ImageOperandsShift {
ImageOperandsVolatileTexelKHRShift = 11,
ImageOperandsSignExtendShift = 12,
ImageOperandsZeroExtendShift = 13,
ImageOperandsNontemporalShift = 14,
ImageOperandsOffsetsShift = 16,
ImageOperandsMax = 0x7fffffff,
};
@@ -377,6 +382,7 @@ enum ImageOperandsMask {
ImageOperandsVolatileTexelKHRMask = 0x00000800,
ImageOperandsSignExtendMask = 0x00001000,
ImageOperandsZeroExtendMask = 0x00002000,
ImageOperandsNontemporalMask = 0x00004000,
ImageOperandsOffsetsMask = 0x00010000,
};
@@ -494,6 +500,7 @@ enum Decoration {
DecorationPerPrimitiveNV = 5271,
DecorationPerViewNV = 5272,
DecorationPerTaskNV = 5273,
DecorationPerVertexKHR = 5285,
DecorationPerVertexNV = 5285,
DecorationNonUniform = 5300,
DecorationNonUniformEXT = 5300,
@@ -539,11 +546,14 @@ enum Decoration {
DecorationPrefetchINTEL = 5902,
DecorationStallEnableINTEL = 5905,
DecorationFuseLoopsInFunctionINTEL = 5907,
DecorationAliasScopeINTEL = 5914,
DecorationNoAliasINTEL = 5915,
DecorationBufferLocationINTEL = 5921,
DecorationIOPipeStorageINTEL = 5944,
DecorationFunctionFloatingPointModeINTEL = 6080,
DecorationSingleElementVectorINTEL = 6085,
DecorationVectorComputeCallableFunctionINTEL = 6087,
DecorationMediaBlockIOINTEL = 6140,
DecorationMax = 0x7fffffff,
};
@@ -628,7 +638,9 @@ enum BuiltIn {
BuiltInLayerPerViewNV = 5279,
BuiltInMeshViewCountNV = 5280,
BuiltInMeshViewIndicesNV = 5281,
BuiltInBaryCoordKHR = 5286,
BuiltInBaryCoordNV = 5286,
BuiltInBaryCoordNoPerspKHR = 5287,
BuiltInBaryCoordNoPerspNV = 5287,
BuiltInFragSizeEXT = 5292,
BuiltInFragmentSizeNV = 5292,
@@ -667,6 +679,7 @@ enum BuiltIn {
BuiltInSMCountNV = 5375,
BuiltInWarpIDNV = 5376,
BuiltInSMIDNV = 5377,
BuiltInCullMaskKHR = 6021,
BuiltInMax = 0x7fffffff,
};
@@ -794,6 +807,8 @@ enum MemoryAccessShift {
MemoryAccessMakePointerVisibleKHRShift = 4,
MemoryAccessNonPrivatePointerShift = 5,
MemoryAccessNonPrivatePointerKHRShift = 5,
MemoryAccessAliasScopeINTELMaskShift = 16,
MemoryAccessNoAliasINTELMaskShift = 17,
MemoryAccessMax = 0x7fffffff,
};
@@ -808,6 +823,8 @@ enum MemoryAccessMask {
MemoryAccessMakePointerVisibleKHRMask = 0x00000010,
MemoryAccessNonPrivatePointerMask = 0x00000020,
MemoryAccessNonPrivatePointerKHRMask = 0x00000020,
MemoryAccessAliasScopeINTELMaskMask = 0x00010000,
MemoryAccessNoAliasINTELMaskMask = 0x00020000,
};
enum Scope {
@@ -920,6 +937,7 @@ enum Capability {
CapabilityGroupNonUniformQuad = 68,
CapabilityShaderLayer = 69,
CapabilityShaderViewportIndex = 70,
CapabilityUniformDecoration = 71,
CapabilityFragmentShadingRateKHR = 4422,
CapabilitySubgroupBallotKHR = 4423,
CapabilityDrawParameters = 4427,
@@ -968,6 +986,7 @@ enum Capability {
CapabilityFragmentFullyCoveredEXT = 5265,
CapabilityMeshShadingNV = 5266,
CapabilityImageFootprintNV = 5282,
CapabilityFragmentBarycentricKHR = 5284,
CapabilityFragmentBarycentricNV = 5284,
CapabilityComputeDerivativeGroupQuadsNV = 5288,
CapabilityFragmentDensityEXT = 5291,
@@ -1012,6 +1031,7 @@ enum Capability {
CapabilityFragmentShaderShadingRateInterlockEXT = 5372,
CapabilityShaderSMBuiltinsNV = 5373,
CapabilityFragmentShaderPixelInterlockEXT = 5378,
CapabilityDemoteToHelperInvocation = 5379,
CapabilityDemoteToHelperInvocationEXT = 5379,
CapabilityBindlessTextureNV = 5390,
CapabilitySubgroupShuffleINTEL = 5568,
@@ -1046,23 +1066,32 @@ enum Capability {
CapabilityFPGAMemoryAccessesINTEL = 5898,
CapabilityFPGAClusterAttributesINTEL = 5904,
CapabilityLoopFuseINTEL = 5906,
CapabilityMemoryAccessAliasingINTEL = 5910,
CapabilityFPGABufferLocationINTEL = 5920,
CapabilityArbitraryPrecisionFixedPointINTEL = 5922,
CapabilityUSMStorageClassesINTEL = 5935,
CapabilityIOPipesINTEL = 5943,
CapabilityBlockingPipesINTEL = 5945,
CapabilityFPGARegINTEL = 5948,
CapabilityDotProductInputAll = 6016,
CapabilityDotProductInputAllKHR = 6016,
CapabilityDotProductInput4x8Bit = 6017,
CapabilityDotProductInput4x8BitKHR = 6017,
CapabilityDotProductInput4x8BitPacked = 6018,
CapabilityDotProductInput4x8BitPackedKHR = 6018,
CapabilityDotProduct = 6019,
CapabilityDotProductKHR = 6019,
CapabilityRayCullMaskKHR = 6020,
CapabilityBitInstructions = 6025,
CapabilityGroupNonUniformRotateKHR = 6026,
CapabilityAtomicFloat32AddEXT = 6033,
CapabilityAtomicFloat64AddEXT = 6034,
CapabilityLongConstantCompositeINTEL = 6089,
CapabilityOptNoneINTEL = 6094,
CapabilityAtomicFloat16AddEXT = 6095,
CapabilityDebugInfoModuleINTEL = 6114,
CapabilitySplitBarrierINTEL = 6141,
CapabilityGroupUniformArithmeticKHR = 6400,
CapabilityMax = 0x7fffffff,
};
@@ -1162,6 +1191,7 @@ enum OverflowModes {
};
enum PackedVectorFormat {
PackedVectorFormatPackedVectorFormat4x8Bit = 0,
PackedVectorFormatPackedVectorFormat4x8BitKHR = 0,
PackedVectorFormatMax = 0x7fffffff,
};
@@ -1517,17 +1547,24 @@ enum Op {
OpSubgroupAllKHR = 4428,
OpSubgroupAnyKHR = 4429,
OpSubgroupAllEqualKHR = 4430,
OpGroupNonUniformRotateKHR = 4431,
OpSubgroupReadInvocationKHR = 4432,
OpTraceRayKHR = 4445,
OpExecuteCallableKHR = 4446,
OpConvertUToAccelerationStructureKHR = 4447,
OpIgnoreIntersectionKHR = 4448,
OpTerminateRayKHR = 4449,
OpSDot = 4450,
OpSDotKHR = 4450,
OpUDot = 4451,
OpUDotKHR = 4451,
OpSUDot = 4452,
OpSUDotKHR = 4452,
OpSDotAccSat = 4453,
OpSDotAccSatKHR = 4453,
OpUDotAccSat = 4454,
OpUDotAccSatKHR = 4454,
OpSUDotAccSat = 4455,
OpSUDotAccSatKHR = 4455,
OpTypeRayQueryKHR = 4472,
OpRayQueryInitializeKHR = 4473,
@@ -1567,6 +1604,7 @@ enum Op {
OpCooperativeMatrixLengthNV = 5362,
OpBeginInvocationInterlockEXT = 5364,
OpEndInvocationInterlockEXT = 5365,
OpDemoteToHelperInvocation = 5380,
OpDemoteToHelperInvocationEXT = 5380,
OpIsHelperInvocationEXT = 5381,
OpConvertUToImageNV = 5391,
@@ -1776,6 +1814,9 @@ enum Op {
OpArbitraryFloatPowRINTEL = 5881,
OpArbitraryFloatPowNINTEL = 5882,
OpLoopControlINTEL = 5887,
OpAliasDomainDeclINTEL = 5911,
OpAliasScopeDeclINTEL = 5912,
OpAliasScopeListDeclINTEL = 5913,
OpFixedSqrtINTEL = 5923,
OpFixedRecipINTEL = 5924,
OpFixedRsqrtINTEL = 5925,
@@ -1814,10 +1855,23 @@ enum Op {
OpTypeStructContinuedINTEL = 6090,
OpConstantCompositeContinuedINTEL = 6091,
OpSpecConstantCompositeContinuedINTEL = 6092,
OpControlBarrierArriveINTEL = 6142,
OpControlBarrierWaitINTEL = 6143,
OpGroupIMulKHR = 6401,
OpGroupFMulKHR = 6402,
OpGroupBitwiseAndKHR = 6403,
OpGroupBitwiseOrKHR = 6404,
OpGroupBitwiseXorKHR = 6405,
OpGroupLogicalAndKHR = 6406,
OpGroupLogicalOrKHR = 6407,
OpGroupLogicalXorKHR = 6408,
OpMax = 0x7fffffff,
};
#ifdef SPV_ENABLE_UTILITY_CODE
#ifndef __cplusplus
#include <stdbool.h>
#endif
inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
*hasResult = *hasResultType = false;
switch (opcode) {
@@ -2172,18 +2226,19 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
case OpSubgroupAllKHR: *hasResult = true; *hasResultType = true; break;
case OpSubgroupAnyKHR: *hasResult = true; *hasResultType = true; break;
case OpSubgroupAllEqualKHR: *hasResult = true; *hasResultType = true; break;
case OpGroupNonUniformRotateKHR: *hasResult = true; *hasResultType = true; break;
case OpSubgroupReadInvocationKHR: *hasResult = true; *hasResultType = true; break;
case OpTraceRayKHR: *hasResult = false; *hasResultType = false; break;
case OpExecuteCallableKHR: *hasResult = false; *hasResultType = false; break;
case OpConvertUToAccelerationStructureKHR: *hasResult = true; *hasResultType = true; break;
case OpIgnoreIntersectionKHR: *hasResult = false; *hasResultType = false; break;
case OpTerminateRayKHR: *hasResult = false; *hasResultType = false; break;
case OpSDotKHR: *hasResult = true; *hasResultType = true; break;
case OpUDotKHR: *hasResult = true; *hasResultType = true; break;
case OpSUDotKHR: *hasResult = true; *hasResultType = true; break;
case OpSDotAccSatKHR: *hasResult = true; *hasResultType = true; break;
case OpUDotAccSatKHR: *hasResult = true; *hasResultType = true; break;
case OpSUDotAccSatKHR: *hasResult = true; *hasResultType = true; break;
case OpSDot: *hasResult = true; *hasResultType = true; break;
case OpUDot: *hasResult = true; *hasResultType = true; break;
case OpSUDot: *hasResult = true; *hasResultType = true; break;
case OpSDotAccSat: *hasResult = true; *hasResultType = true; break;
case OpUDotAccSat: *hasResult = true; *hasResultType = true; break;
case OpSUDotAccSat: *hasResult = true; *hasResultType = true; break;
case OpTypeRayQueryKHR: *hasResult = true; *hasResultType = false; break;
case OpRayQueryInitializeKHR: *hasResult = false; *hasResultType = false; break;
case OpRayQueryTerminateKHR: *hasResult = false; *hasResultType = false; break;
@@ -2220,7 +2275,7 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
case OpCooperativeMatrixLengthNV: *hasResult = true; *hasResultType = true; break;
case OpBeginInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break;
case OpEndInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break;
case OpDemoteToHelperInvocationEXT: *hasResult = false; *hasResultType = false; break;
case OpDemoteToHelperInvocation: *hasResult = false; *hasResultType = false; break;
case OpIsHelperInvocationEXT: *hasResult = true; *hasResultType = true; break;
case OpConvertUToImageNV: *hasResult = true; *hasResultType = true; break;
case OpConvertUToSamplerNV: *hasResult = true; *hasResultType = true; break;
@@ -2427,6 +2482,9 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
case OpArbitraryFloatPowRINTEL: *hasResult = true; *hasResultType = true; break;
case OpArbitraryFloatPowNINTEL: *hasResult = true; *hasResultType = true; break;
case OpLoopControlINTEL: *hasResult = false; *hasResultType = false; break;
case OpAliasDomainDeclINTEL: *hasResult = true; *hasResultType = false; break;
case OpAliasScopeDeclINTEL: *hasResult = true; *hasResultType = false; break;
case OpAliasScopeListDeclINTEL: *hasResult = true; *hasResultType = false; break;
case OpFixedSqrtINTEL: *hasResult = true; *hasResultType = true; break;
case OpFixedRecipINTEL: *hasResult = true; *hasResultType = true; break;
case OpFixedRsqrtINTEL: *hasResult = true; *hasResultType = true; break;
@@ -2465,6 +2523,16 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
case OpTypeStructContinuedINTEL: *hasResult = false; *hasResultType = false; break;
case OpConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break;
case OpSpecConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break;
case OpControlBarrierArriveINTEL: *hasResult = false; *hasResultType = false; break;
case OpControlBarrierWaitINTEL: *hasResult = false; *hasResultType = false; break;
case OpGroupIMulKHR: *hasResult = true; *hasResultType = true; break;
case OpGroupFMulKHR: *hasResult = true; *hasResultType = true; break;
case OpGroupBitwiseAndKHR: *hasResult = true; *hasResultType = true; break;
case OpGroupBitwiseOrKHR: *hasResult = true; *hasResultType = true; break;
case OpGroupBitwiseXorKHR: *hasResult = true; *hasResultType = true; break;
case OpGroupLogicalAndKHR: *hasResult = true; *hasResultType = true; break;
case OpGroupLogicalOrKHR: *hasResult = true; *hasResultType = true; break;
case OpGroupLogicalXorKHR: *hasResult = true; *hasResultType = true; break;
}
}
#endif /* SPV_ENABLE_UTILITY_CODE */
@@ -26,7 +26,7 @@
// the Binary Section of the SPIR-V specification.
// Enumeration tokens for SPIR-V, in various styles:
// C, C++, C++11, JSON, Lua, Python, C#, D
// C, C++, C++11, JSON, Lua, Python, C#, D, Beef
//
// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL
// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL
@@ -36,6 +36,8 @@
// - C# will use enum classes in the Specification class located in the "Spv" namespace,
// e.g.: Spv.Specification.SourceLanguage.GLSL
// - D will have tokens under the "spv" module, e.g: spv.SourceLanguage.GLSL
// - Beef will use enum classes in the Specification class located in the "Spv" namespace,
// e.g.: Spv.Specification.SourceLanguage.GLSL
//
// Some tokens act like mask values, which can be OR'd together,
// while others are mutually exclusive. The mask-like ones have
@@ -49,12 +51,12 @@ namespace spv {
typedef unsigned int Id;
#define SPV_VERSION 0x10500
#define SPV_REVISION 4
#define SPV_VERSION 0x10600
#define SPV_REVISION 1
static const unsigned int MagicNumber = 0x07230203;
static const unsigned int Version = 0x00010500;
static const unsigned int Revision = 4;
static const unsigned int Version = 0x00010600;
static const unsigned int Revision = 1;
static const unsigned int OpCodeMask = 0xffff;
static const unsigned int WordCountShift = 16;
@@ -66,6 +68,7 @@ enum class SourceLanguage : unsigned {
OpenCL_CPP = 4,
HLSL = 5,
CPP_for_OpenCL = 6,
SYCL = 7,
Max = 0x7fffffff,
};
@@ -180,6 +183,7 @@ enum class ExecutionMode : unsigned {
NoGlobalOffsetINTEL = 5895,
NumSIMDWorkitemsINTEL = 5896,
SchedulerTargetFmaxMhzINTEL = 5903,
NamedBarrierCountINTEL = 6417,
Max = 0x7fffffff,
};
@@ -353,6 +357,7 @@ enum class ImageOperandsShift : unsigned {
VolatileTexelKHR = 11,
SignExtend = 12,
ZeroExtend = 13,
Nontemporal = 14,
Offsets = 16,
Max = 0x7fffffff,
};
@@ -377,6 +382,7 @@ enum class ImageOperandsMask : unsigned {
VolatileTexelKHR = 0x00000800,
SignExtend = 0x00001000,
ZeroExtend = 0x00002000,
Nontemporal = 0x00004000,
Offsets = 0x00010000,
};
@@ -494,6 +500,7 @@ enum class Decoration : unsigned {
PerPrimitiveNV = 5271,
PerViewNV = 5272,
PerTaskNV = 5273,
PerVertexKHR = 5285,
PerVertexNV = 5285,
NonUniform = 5300,
NonUniformEXT = 5300,
@@ -539,11 +546,14 @@ enum class Decoration : unsigned {
PrefetchINTEL = 5902,
StallEnableINTEL = 5905,
FuseLoopsInFunctionINTEL = 5907,
AliasScopeINTEL = 5914,
NoAliasINTEL = 5915,
BufferLocationINTEL = 5921,
IOPipeStorageINTEL = 5944,
FunctionFloatingPointModeINTEL = 6080,
SingleElementVectorINTEL = 6085,
VectorComputeCallableFunctionINTEL = 6087,
MediaBlockIOINTEL = 6140,
Max = 0x7fffffff,
};
@@ -628,7 +638,9 @@ enum class BuiltIn : unsigned {
LayerPerViewNV = 5279,
MeshViewCountNV = 5280,
MeshViewIndicesNV = 5281,
BaryCoordKHR = 5286,
BaryCoordNV = 5286,
BaryCoordNoPerspKHR = 5287,
BaryCoordNoPerspNV = 5287,
FragSizeEXT = 5292,
FragmentSizeNV = 5292,
@@ -667,6 +679,7 @@ enum class BuiltIn : unsigned {
SMCountNV = 5375,
WarpIDNV = 5376,
SMIDNV = 5377,
CullMaskKHR = 6021,
Max = 0x7fffffff,
};
@@ -794,6 +807,8 @@ enum class MemoryAccessShift : unsigned {
MakePointerVisibleKHR = 4,
NonPrivatePointer = 5,
NonPrivatePointerKHR = 5,
AliasScopeINTELMask = 16,
NoAliasINTELMask = 17,
Max = 0x7fffffff,
};
@@ -808,6 +823,8 @@ enum class MemoryAccessMask : unsigned {
MakePointerVisibleKHR = 0x00000010,
NonPrivatePointer = 0x00000020,
NonPrivatePointerKHR = 0x00000020,
AliasScopeINTELMask = 0x00010000,
NoAliasINTELMask = 0x00020000,
};
enum class Scope : unsigned {
@@ -920,6 +937,7 @@ enum class Capability : unsigned {
GroupNonUniformQuad = 68,
ShaderLayer = 69,
ShaderViewportIndex = 70,
UniformDecoration = 71,
FragmentShadingRateKHR = 4422,
SubgroupBallotKHR = 4423,
DrawParameters = 4427,
@@ -968,6 +986,7 @@ enum class Capability : unsigned {
FragmentFullyCoveredEXT = 5265,
MeshShadingNV = 5266,
ImageFootprintNV = 5282,
FragmentBarycentricKHR = 5284,
FragmentBarycentricNV = 5284,
ComputeDerivativeGroupQuadsNV = 5288,
FragmentDensityEXT = 5291,
@@ -1012,6 +1031,7 @@ enum class Capability : unsigned {
FragmentShaderShadingRateInterlockEXT = 5372,
ShaderSMBuiltinsNV = 5373,
FragmentShaderPixelInterlockEXT = 5378,
DemoteToHelperInvocation = 5379,
DemoteToHelperInvocationEXT = 5379,
BindlessTextureNV = 5390,
SubgroupShuffleINTEL = 5568,
@@ -1046,23 +1066,32 @@ enum class Capability : unsigned {
FPGAMemoryAccessesINTEL = 5898,
FPGAClusterAttributesINTEL = 5904,
LoopFuseINTEL = 5906,
MemoryAccessAliasingINTEL = 5910,
FPGABufferLocationINTEL = 5920,
ArbitraryPrecisionFixedPointINTEL = 5922,
USMStorageClassesINTEL = 5935,
IOPipesINTEL = 5943,
BlockingPipesINTEL = 5945,
FPGARegINTEL = 5948,
DotProductInputAll = 6016,
DotProductInputAllKHR = 6016,
DotProductInput4x8Bit = 6017,
DotProductInput4x8BitKHR = 6017,
DotProductInput4x8BitPacked = 6018,
DotProductInput4x8BitPackedKHR = 6018,
DotProduct = 6019,
DotProductKHR = 6019,
RayCullMaskKHR = 6020,
BitInstructions = 6025,
GroupNonUniformRotateKHR = 6026,
AtomicFloat32AddEXT = 6033,
AtomicFloat64AddEXT = 6034,
LongConstantCompositeINTEL = 6089,
OptNoneINTEL = 6094,
AtomicFloat16AddEXT = 6095,
DebugInfoModuleINTEL = 6114,
SplitBarrierINTEL = 6141,
GroupUniformArithmeticKHR = 6400,
Max = 0x7fffffff,
};
@@ -1162,6 +1191,7 @@ enum class OverflowModes : unsigned {
};
enum class PackedVectorFormat : unsigned {
PackedVectorFormat4x8Bit = 0,
PackedVectorFormat4x8BitKHR = 0,
Max = 0x7fffffff,
};
@@ -1517,17 +1547,24 @@ enum class Op : unsigned {
OpSubgroupAllKHR = 4428,
OpSubgroupAnyKHR = 4429,
OpSubgroupAllEqualKHR = 4430,
OpGroupNonUniformRotateKHR = 4431,
OpSubgroupReadInvocationKHR = 4432,
OpTraceRayKHR = 4445,
OpExecuteCallableKHR = 4446,
OpConvertUToAccelerationStructureKHR = 4447,
OpIgnoreIntersectionKHR = 4448,
OpTerminateRayKHR = 4449,
OpSDot = 4450,
OpSDotKHR = 4450,
OpUDot = 4451,
OpUDotKHR = 4451,
OpSUDot = 4452,
OpSUDotKHR = 4452,
OpSDotAccSat = 4453,
OpSDotAccSatKHR = 4453,
OpUDotAccSat = 4454,
OpUDotAccSatKHR = 4454,
OpSUDotAccSat = 4455,
OpSUDotAccSatKHR = 4455,
OpTypeRayQueryKHR = 4472,
OpRayQueryInitializeKHR = 4473,
@@ -1567,6 +1604,7 @@ enum class Op : unsigned {
OpCooperativeMatrixLengthNV = 5362,
OpBeginInvocationInterlockEXT = 5364,
OpEndInvocationInterlockEXT = 5365,
OpDemoteToHelperInvocation = 5380,
OpDemoteToHelperInvocationEXT = 5380,
OpIsHelperInvocationEXT = 5381,
OpConvertUToImageNV = 5391,
@@ -1776,6 +1814,9 @@ enum class Op : unsigned {
OpArbitraryFloatPowRINTEL = 5881,
OpArbitraryFloatPowNINTEL = 5882,
OpLoopControlINTEL = 5887,
OpAliasDomainDeclINTEL = 5911,
OpAliasScopeDeclINTEL = 5912,
OpAliasScopeListDeclINTEL = 5913,
OpFixedSqrtINTEL = 5923,
OpFixedRecipINTEL = 5924,
OpFixedRsqrtINTEL = 5925,
@@ -1814,10 +1855,23 @@ enum class Op : unsigned {
OpTypeStructContinuedINTEL = 6090,
OpConstantCompositeContinuedINTEL = 6091,
OpSpecConstantCompositeContinuedINTEL = 6092,
OpControlBarrierArriveINTEL = 6142,
OpControlBarrierWaitINTEL = 6143,
OpGroupIMulKHR = 6401,
OpGroupFMulKHR = 6402,
OpGroupBitwiseAndKHR = 6403,
OpGroupBitwiseOrKHR = 6404,
OpGroupBitwiseXorKHR = 6405,
OpGroupLogicalAndKHR = 6406,
OpGroupLogicalOrKHR = 6407,
OpGroupLogicalXorKHR = 6408,
Max = 0x7fffffff,
};
#ifdef SPV_ENABLE_UTILITY_CODE
#ifndef __cplusplus
#include <stdbool.h>
#endif
inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
*hasResult = *hasResultType = false;
switch (opcode) {
@@ -2172,18 +2226,19 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
case Op::OpSubgroupAllKHR: *hasResult = true; *hasResultType = true; break;
case Op::OpSubgroupAnyKHR: *hasResult = true; *hasResultType = true; break;
case Op::OpSubgroupAllEqualKHR: *hasResult = true; *hasResultType = true; break;
case Op::OpGroupNonUniformRotateKHR: *hasResult = true; *hasResultType = true; break;
case Op::OpSubgroupReadInvocationKHR: *hasResult = true; *hasResultType = true; break;
case Op::OpTraceRayKHR: *hasResult = false; *hasResultType = false; break;
case Op::OpExecuteCallableKHR: *hasResult = false; *hasResultType = false; break;
case Op::OpConvertUToAccelerationStructureKHR: *hasResult = true; *hasResultType = true; break;
case Op::OpIgnoreIntersectionKHR: *hasResult = false; *hasResultType = false; break;
case Op::OpTerminateRayKHR: *hasResult = false; *hasResultType = false; break;
case Op::OpSDotKHR: *hasResult = true; *hasResultType = true; break;
case Op::OpUDotKHR: *hasResult = true; *hasResultType = true; break;
case Op::OpSUDotKHR: *hasResult = true; *hasResultType = true; break;
case Op::OpSDotAccSatKHR: *hasResult = true; *hasResultType = true; break;
case Op::OpUDotAccSatKHR: *hasResult = true; *hasResultType = true; break;
case Op::OpSUDotAccSatKHR: *hasResult = true; *hasResultType = true; break;
case Op::OpSDot: *hasResult = true; *hasResultType = true; break;
case Op::OpUDot: *hasResult = true; *hasResultType = true; break;
case Op::OpSUDot: *hasResult = true; *hasResultType = true; break;
case Op::OpSDotAccSat: *hasResult = true; *hasResultType = true; break;
case Op::OpUDotAccSat: *hasResult = true; *hasResultType = true; break;
case Op::OpSUDotAccSat: *hasResult = true; *hasResultType = true; break;
case Op::OpTypeRayQueryKHR: *hasResult = true; *hasResultType = false; break;
case Op::OpRayQueryInitializeKHR: *hasResult = false; *hasResultType = false; break;
case Op::OpRayQueryTerminateKHR: *hasResult = false; *hasResultType = false; break;
@@ -2220,7 +2275,7 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
case Op::OpCooperativeMatrixLengthNV: *hasResult = true; *hasResultType = true; break;
case Op::OpBeginInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break;
case Op::OpEndInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break;
case Op::OpDemoteToHelperInvocationEXT: *hasResult = false; *hasResultType = false; break;
case Op::OpDemoteToHelperInvocation: *hasResult = false; *hasResultType = false; break;
case Op::OpIsHelperInvocationEXT: *hasResult = true; *hasResultType = true; break;
case Op::OpConvertUToImageNV: *hasResult = true; *hasResultType = true; break;
case Op::OpConvertUToSamplerNV: *hasResult = true; *hasResultType = true; break;
@@ -2427,6 +2482,9 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
case Op::OpArbitraryFloatPowRINTEL: *hasResult = true; *hasResultType = true; break;
case Op::OpArbitraryFloatPowNINTEL: *hasResult = true; *hasResultType = true; break;
case Op::OpLoopControlINTEL: *hasResult = false; *hasResultType = false; break;
case Op::OpAliasDomainDeclINTEL: *hasResult = true; *hasResultType = false; break;
case Op::OpAliasScopeDeclINTEL: *hasResult = true; *hasResultType = false; break;
case Op::OpAliasScopeListDeclINTEL: *hasResult = true; *hasResultType = false; break;
case Op::OpFixedSqrtINTEL: *hasResult = true; *hasResultType = true; break;
case Op::OpFixedRecipINTEL: *hasResult = true; *hasResultType = true; break;
case Op::OpFixedRsqrtINTEL: *hasResult = true; *hasResultType = true; break;
@@ -2465,6 +2523,16 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
case Op::OpTypeStructContinuedINTEL: *hasResult = false; *hasResultType = false; break;
case Op::OpConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break;
case Op::OpSpecConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break;
case Op::OpControlBarrierArriveINTEL: *hasResult = false; *hasResultType = false; break;
case Op::OpControlBarrierWaitINTEL: *hasResult = false; *hasResultType = false; break;
case Op::OpGroupIMulKHR: *hasResult = true; *hasResultType = true; break;
case Op::OpGroupFMulKHR: *hasResult = true; *hasResultType = true; break;
case Op::OpGroupBitwiseAndKHR: *hasResult = true; *hasResultType = true; break;
case Op::OpGroupBitwiseOrKHR: *hasResult = true; *hasResultType = true; break;
case Op::OpGroupBitwiseXorKHR: *hasResult = true; *hasResultType = true; break;
case Op::OpGroupLogicalAndKHR: *hasResult = true; *hasResultType = true; break;
case Op::OpGroupLogicalOrKHR: *hasResult = true; *hasResultType = true; break;
case Op::OpGroupLogicalXorKHR: *hasResult = true; *hasResultType = true; break;
}
}
#endif /* SPV_ENABLE_UTILITY_CODE */
@@ -36,7 +36,7 @@
],
[
"Enumeration tokens for SPIR-V, in various styles:",
" C, C++, C++11, JSON, Lua, Python, C#, D",
" C, C++, C++11, JSON, Lua, Python, C#, D, Beef",
"",
"- C will have tokens with a \"Spv\" prefix, e.g.: SpvSourceLanguageGLSL",
"- C++ will have tokens in the \"spv\" name space, e.g.: spv::SourceLanguageGLSL",
@@ -46,6 +46,8 @@
"- C# will use enum classes in the Specification class located in the \"Spv\" namespace,",
" e.g.: Spv.Specification.SourceLanguage.GLSL",
"- D will have tokens under the \"spv\" module, e.g: spv.SourceLanguage.GLSL",
"- Beef will use enum classes in the Specification class located in the \"Spv\" namespace,",
" e.g.: Spv.Specification.SourceLanguage.GLSL",
"",
"Some tokens act like mask values, which can be OR'd together,",
"while others are mutually exclusive. The mask-like ones have",
@@ -54,8 +56,8 @@
]
],
"MagicNumber": 119734787,
"Version": 66816,
"Revision": 4,
"Version": 67072,
"Revision": 1,
"OpCodeMask": 65535,
"WordCountShift": 16
},
@@ -72,7 +74,8 @@
"OpenCL_C": 3,
"OpenCL_CPP": 4,
"HLSL": 5,
"CPP_for_OpenCL": 6
"CPP_for_OpenCL": 6,
"SYCL": 7
}
},
{
@@ -198,7 +201,8 @@
"MaxWorkDimINTEL": 5894,
"NoGlobalOffsetINTEL": 5895,
"NumSIMDWorkitemsINTEL": 5896,
"SchedulerTargetFmaxMhzINTEL": 5903
"SchedulerTargetFmaxMhzINTEL": 5903,
"NamedBarrierCountINTEL": 6417
}
},
{
@@ -396,6 +400,7 @@
"VolatileTexelKHR": 11,
"SignExtend": 12,
"ZeroExtend": 13,
"Nontemporal": 14,
"Offsets": 16
}
},
@@ -521,6 +526,7 @@
"PerPrimitiveNV": 5271,
"PerViewNV": 5272,
"PerTaskNV": 5273,
"PerVertexKHR": 5285,
"PerVertexNV": 5285,
"NonUniform": 5300,
"NonUniformEXT": 5300,
@@ -566,11 +572,14 @@
"PrefetchINTEL": 5902,
"StallEnableINTEL": 5905,
"FuseLoopsInFunctionINTEL": 5907,
"AliasScopeINTEL": 5914,
"NoAliasINTEL": 5915,
"BufferLocationINTEL": 5921,
"IOPipeStorageINTEL": 5944,
"FunctionFloatingPointModeINTEL": 6080,
"SingleElementVectorINTEL": 6085,
"VectorComputeCallableFunctionINTEL": 6087
"VectorComputeCallableFunctionINTEL": 6087,
"MediaBlockIOINTEL": 6140
}
},
{
@@ -658,7 +667,9 @@
"LayerPerViewNV": 5279,
"MeshViewCountNV": 5280,
"MeshViewIndicesNV": 5281,
"BaryCoordKHR": 5286,
"BaryCoordNV": 5286,
"BaryCoordNoPerspKHR": 5287,
"BaryCoordNoPerspNV": 5287,
"FragSizeEXT": 5292,
"FragmentSizeNV": 5292,
@@ -696,7 +707,8 @@
"WarpsPerSMNV": 5374,
"SMCountNV": 5375,
"WarpIDNV": 5376,
"SMIDNV": 5377
"SMIDNV": 5377,
"CullMaskKHR": 6021
}
},
{
@@ -781,7 +793,9 @@
"MakePointerVisible": 4,
"MakePointerVisibleKHR": 4,
"NonPrivatePointer": 5,
"NonPrivatePointerKHR": 5
"NonPrivatePointerKHR": 5,
"AliasScopeINTELMask": 16,
"NoAliasINTELMask": 17
}
},
{
@@ -905,6 +919,7 @@
"GroupNonUniformQuad": 68,
"ShaderLayer": 69,
"ShaderViewportIndex": 70,
"UniformDecoration": 71,
"FragmentShadingRateKHR": 4422,
"SubgroupBallotKHR": 4423,
"DrawParameters": 4427,
@@ -953,6 +968,7 @@
"FragmentFullyCoveredEXT": 5265,
"MeshShadingNV": 5266,
"ImageFootprintNV": 5282,
"FragmentBarycentricKHR": 5284,
"FragmentBarycentricNV": 5284,
"ComputeDerivativeGroupQuadsNV": 5288,
"FragmentDensityEXT": 5291,
@@ -997,6 +1013,7 @@
"FragmentShaderShadingRateInterlockEXT": 5372,
"ShaderSMBuiltinsNV": 5373,
"FragmentShaderPixelInterlockEXT": 5378,
"DemoteToHelperInvocation": 5379,
"DemoteToHelperInvocationEXT": 5379,
"BindlessTextureNV": 5390,
"SubgroupShuffleINTEL": 5568,
@@ -1031,23 +1048,32 @@
"FPGAMemoryAccessesINTEL": 5898,
"FPGAClusterAttributesINTEL": 5904,
"LoopFuseINTEL": 5906,
"MemoryAccessAliasingINTEL": 5910,
"FPGABufferLocationINTEL": 5920,
"ArbitraryPrecisionFixedPointINTEL": 5922,
"USMStorageClassesINTEL": 5935,
"IOPipesINTEL": 5943,
"BlockingPipesINTEL": 5945,
"FPGARegINTEL": 5948,
"DotProductInputAll": 6016,
"DotProductInputAllKHR": 6016,
"DotProductInput4x8Bit": 6017,
"DotProductInput4x8BitKHR": 6017,
"DotProductInput4x8BitPacked": 6018,
"DotProductInput4x8BitPackedKHR": 6018,
"DotProduct": 6019,
"DotProductKHR": 6019,
"RayCullMaskKHR": 6020,
"BitInstructions": 6025,
"GroupNonUniformRotateKHR": 6026,
"AtomicFloat32AddEXT": 6033,
"AtomicFloat64AddEXT": 6034,
"LongConstantCompositeINTEL": 6089,
"OptNoneINTEL": 6094,
"AtomicFloat16AddEXT": 6095,
"DebugInfoModuleINTEL": 6114
"DebugInfoModuleINTEL": 6114,
"SplitBarrierINTEL": 6141,
"GroupUniformArithmeticKHR": 6400
}
},
{
@@ -1155,6 +1181,7 @@
"Type": "Value",
"Values":
{
"PackedVectorFormat4x8Bit": 0,
"PackedVectorFormat4x8BitKHR": 0
}
},
@@ -1513,17 +1540,24 @@
"OpSubgroupAllKHR": 4428,
"OpSubgroupAnyKHR": 4429,
"OpSubgroupAllEqualKHR": 4430,
"OpGroupNonUniformRotateKHR": 4431,
"OpSubgroupReadInvocationKHR": 4432,
"OpTraceRayKHR": 4445,
"OpExecuteCallableKHR": 4446,
"OpConvertUToAccelerationStructureKHR": 4447,
"OpIgnoreIntersectionKHR": 4448,
"OpTerminateRayKHR": 4449,
"OpSDot": 4450,
"OpSDotKHR": 4450,
"OpUDot": 4451,
"OpUDotKHR": 4451,
"OpSUDot": 4452,
"OpSUDotKHR": 4452,
"OpSDotAccSat": 4453,
"OpSDotAccSatKHR": 4453,
"OpUDotAccSat": 4454,
"OpUDotAccSatKHR": 4454,
"OpSUDotAccSat": 4455,
"OpSUDotAccSatKHR": 4455,
"OpTypeRayQueryKHR": 4472,
"OpRayQueryInitializeKHR": 4473,
@@ -1563,6 +1597,7 @@
"OpCooperativeMatrixLengthNV": 5362,
"OpBeginInvocationInterlockEXT": 5364,
"OpEndInvocationInterlockEXT": 5365,
"OpDemoteToHelperInvocation": 5380,
"OpDemoteToHelperInvocationEXT": 5380,
"OpIsHelperInvocationEXT": 5381,
"OpConvertUToImageNV": 5391,
@@ -1772,6 +1807,9 @@
"OpArbitraryFloatPowRINTEL": 5881,
"OpArbitraryFloatPowNINTEL": 5882,
"OpLoopControlINTEL": 5887,
"OpAliasDomainDeclINTEL": 5911,
"OpAliasScopeDeclINTEL": 5912,
"OpAliasScopeListDeclINTEL": 5913,
"OpFixedSqrtINTEL": 5923,
"OpFixedRecipINTEL": 5924,
"OpFixedRsqrtINTEL": 5925,
@@ -1809,7 +1847,17 @@
"OpTypeBufferSurfaceINTEL": 6086,
"OpTypeStructContinuedINTEL": 6090,
"OpConstantCompositeContinuedINTEL": 6091,
"OpSpecConstantCompositeContinuedINTEL": 6092
"OpSpecConstantCompositeContinuedINTEL": 6092,
"OpControlBarrierArriveINTEL": 6142,
"OpControlBarrierWaitINTEL": 6143,
"OpGroupIMulKHR": 6401,
"OpGroupFMulKHR": 6402,
"OpGroupBitwiseAndKHR": 6403,
"OpGroupBitwiseOrKHR": 6404,
"OpGroupBitwiseXorKHR": 6405,
"OpGroupLogicalAndKHR": 6406,
"OpGroupLogicalOrKHR": 6407,
"OpGroupLogicalXorKHR": 6408
}
}
]
@@ -26,7 +26,7 @@
-- the Binary Section of the SPIR-V specification.
-- Enumeration tokens for SPIR-V, in various styles:
-- C, C++, C++11, JSON, Lua, Python, C#, D
-- C, C++, C++11, JSON, Lua, Python, C#, D, Beef
--
-- - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL
-- - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL
@@ -36,6 +36,8 @@
-- - C# will use enum classes in the Specification class located in the "Spv" namespace,
-- e.g.: Spv.Specification.SourceLanguage.GLSL
-- - D will have tokens under the "spv" module, e.g: spv.SourceLanguage.GLSL
-- - Beef will use enum classes in the Specification class located in the "Spv" namespace,
-- e.g.: Spv.Specification.SourceLanguage.GLSL
--
-- Some tokens act like mask values, which can be OR'd together,
-- while others are mutually exclusive. The mask-like ones have
@@ -44,8 +46,8 @@
spv = {
MagicNumber = 0x07230203,
Version = 0x00010500,
Revision = 4,
Version = 0x00010600,
Revision = 1,
OpCodeMask = 0xffff,
WordCountShift = 16,
@@ -57,6 +59,7 @@ spv = {
OpenCL_CPP = 4,
HLSL = 5,
CPP_for_OpenCL = 6,
SYCL = 7,
},
ExecutionModel = {
@@ -167,6 +170,7 @@ spv = {
NoGlobalOffsetINTEL = 5895,
NumSIMDWorkitemsINTEL = 5896,
SchedulerTargetFmaxMhzINTEL = 5903,
NamedBarrierCountINTEL = 6417,
},
StorageClass = {
@@ -332,6 +336,7 @@ spv = {
VolatileTexelKHR = 11,
SignExtend = 12,
ZeroExtend = 13,
Nontemporal = 14,
Offsets = 16,
},
@@ -355,6 +360,7 @@ spv = {
VolatileTexelKHR = 0x00000800,
SignExtend = 0x00001000,
ZeroExtend = 0x00002000,
Nontemporal = 0x00004000,
Offsets = 0x00010000,
},
@@ -467,6 +473,7 @@ spv = {
PerPrimitiveNV = 5271,
PerViewNV = 5272,
PerTaskNV = 5273,
PerVertexKHR = 5285,
PerVertexNV = 5285,
NonUniform = 5300,
NonUniformEXT = 5300,
@@ -512,11 +519,14 @@ spv = {
PrefetchINTEL = 5902,
StallEnableINTEL = 5905,
FuseLoopsInFunctionINTEL = 5907,
AliasScopeINTEL = 5914,
NoAliasINTEL = 5915,
BufferLocationINTEL = 5921,
IOPipeStorageINTEL = 5944,
FunctionFloatingPointModeINTEL = 6080,
SingleElementVectorINTEL = 6085,
VectorComputeCallableFunctionINTEL = 6087,
MediaBlockIOINTEL = 6140,
},
BuiltIn = {
@@ -600,7 +610,9 @@ spv = {
LayerPerViewNV = 5279,
MeshViewCountNV = 5280,
MeshViewIndicesNV = 5281,
BaryCoordKHR = 5286,
BaryCoordNV = 5286,
BaryCoordNoPerspKHR = 5287,
BaryCoordNoPerspNV = 5287,
FragSizeEXT = 5292,
FragmentSizeNV = 5292,
@@ -639,6 +651,7 @@ spv = {
SMCountNV = 5375,
WarpIDNV = 5376,
SMIDNV = 5377,
CullMaskKHR = 6021,
},
SelectionControlShift = {
@@ -761,6 +774,8 @@ spv = {
MakePointerVisibleKHR = 4,
NonPrivatePointer = 5,
NonPrivatePointerKHR = 5,
AliasScopeINTELMask = 16,
NoAliasINTELMask = 17,
},
MemoryAccessMask = {
@@ -774,6 +789,8 @@ spv = {
MakePointerVisibleKHR = 0x00000010,
NonPrivatePointer = 0x00000020,
NonPrivatePointerKHR = 0x00000020,
AliasScopeINTELMask = 0x00010000,
NoAliasINTELMask = 0x00020000,
},
Scope = {
@@ -882,6 +899,7 @@ spv = {
GroupNonUniformQuad = 68,
ShaderLayer = 69,
ShaderViewportIndex = 70,
UniformDecoration = 71,
FragmentShadingRateKHR = 4422,
SubgroupBallotKHR = 4423,
DrawParameters = 4427,
@@ -930,6 +948,7 @@ spv = {
FragmentFullyCoveredEXT = 5265,
MeshShadingNV = 5266,
ImageFootprintNV = 5282,
FragmentBarycentricKHR = 5284,
FragmentBarycentricNV = 5284,
ComputeDerivativeGroupQuadsNV = 5288,
FragmentDensityEXT = 5291,
@@ -974,6 +993,7 @@ spv = {
FragmentShaderShadingRateInterlockEXT = 5372,
ShaderSMBuiltinsNV = 5373,
FragmentShaderPixelInterlockEXT = 5378,
DemoteToHelperInvocation = 5379,
DemoteToHelperInvocationEXT = 5379,
BindlessTextureNV = 5390,
SubgroupShuffleINTEL = 5568,
@@ -1008,23 +1028,32 @@ spv = {
FPGAMemoryAccessesINTEL = 5898,
FPGAClusterAttributesINTEL = 5904,
LoopFuseINTEL = 5906,
MemoryAccessAliasingINTEL = 5910,
FPGABufferLocationINTEL = 5920,
ArbitraryPrecisionFixedPointINTEL = 5922,
USMStorageClassesINTEL = 5935,
IOPipesINTEL = 5943,
BlockingPipesINTEL = 5945,
FPGARegINTEL = 5948,
DotProductInputAll = 6016,
DotProductInputAllKHR = 6016,
DotProductInput4x8Bit = 6017,
DotProductInput4x8BitKHR = 6017,
DotProductInput4x8BitPacked = 6018,
DotProductInput4x8BitPackedKHR = 6018,
DotProduct = 6019,
DotProductKHR = 6019,
RayCullMaskKHR = 6020,
BitInstructions = 6025,
GroupNonUniformRotateKHR = 6026,
AtomicFloat32AddEXT = 6033,
AtomicFloat64AddEXT = 6034,
LongConstantCompositeINTEL = 6089,
OptNoneINTEL = 6094,
AtomicFloat16AddEXT = 6095,
DebugInfoModuleINTEL = 6114,
SplitBarrierINTEL = 6141,
GroupUniformArithmeticKHR = 6400,
},
RayFlagsShift = {
@@ -1114,6 +1143,7 @@ spv = {
},
PackedVectorFormat = {
PackedVectorFormat4x8Bit = 0,
PackedVectorFormat4x8BitKHR = 0,
},
@@ -1468,17 +1498,24 @@ spv = {
OpSubgroupAllKHR = 4428,
OpSubgroupAnyKHR = 4429,
OpSubgroupAllEqualKHR = 4430,
OpGroupNonUniformRotateKHR = 4431,
OpSubgroupReadInvocationKHR = 4432,
OpTraceRayKHR = 4445,
OpExecuteCallableKHR = 4446,
OpConvertUToAccelerationStructureKHR = 4447,
OpIgnoreIntersectionKHR = 4448,
OpTerminateRayKHR = 4449,
OpSDot = 4450,
OpSDotKHR = 4450,
OpUDot = 4451,
OpUDotKHR = 4451,
OpSUDot = 4452,
OpSUDotKHR = 4452,
OpSDotAccSat = 4453,
OpSDotAccSatKHR = 4453,
OpUDotAccSat = 4454,
OpUDotAccSatKHR = 4454,
OpSUDotAccSat = 4455,
OpSUDotAccSatKHR = 4455,
OpTypeRayQueryKHR = 4472,
OpRayQueryInitializeKHR = 4473,
@@ -1518,6 +1555,7 @@ spv = {
OpCooperativeMatrixLengthNV = 5362,
OpBeginInvocationInterlockEXT = 5364,
OpEndInvocationInterlockEXT = 5365,
OpDemoteToHelperInvocation = 5380,
OpDemoteToHelperInvocationEXT = 5380,
OpIsHelperInvocationEXT = 5381,
OpConvertUToImageNV = 5391,
@@ -1727,6 +1765,9 @@ spv = {
OpArbitraryFloatPowRINTEL = 5881,
OpArbitraryFloatPowNINTEL = 5882,
OpLoopControlINTEL = 5887,
OpAliasDomainDeclINTEL = 5911,
OpAliasScopeDeclINTEL = 5912,
OpAliasScopeListDeclINTEL = 5913,
OpFixedSqrtINTEL = 5923,
OpFixedRecipINTEL = 5924,
OpFixedRsqrtINTEL = 5925,
@@ -1765,6 +1806,16 @@ spv = {
OpTypeStructContinuedINTEL = 6090,
OpConstantCompositeContinuedINTEL = 6091,
OpSpecConstantCompositeContinuedINTEL = 6092,
OpControlBarrierArriveINTEL = 6142,
OpControlBarrierWaitINTEL = 6143,
OpGroupIMulKHR = 6401,
OpGroupFMulKHR = 6402,
OpGroupBitwiseAndKHR = 6403,
OpGroupBitwiseOrKHR = 6404,
OpGroupBitwiseXorKHR = 6405,
OpGroupLogicalAndKHR = 6406,
OpGroupLogicalOrKHR = 6407,
OpGroupLogicalXorKHR = 6408,
},
}
@@ -26,7 +26,7 @@
# the Binary Section of the SPIR-V specification.
# Enumeration tokens for SPIR-V, in various styles:
# C, C++, C++11, JSON, Lua, Python, C#, D
# C, C++, C++11, JSON, Lua, Python, C#, D, Beef
#
# - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL
# - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL
@@ -36,6 +36,8 @@
# - C# will use enum classes in the Specification class located in the "Spv" namespace,
# e.g.: Spv.Specification.SourceLanguage.GLSL
# - D will have tokens under the "spv" module, e.g: spv.SourceLanguage.GLSL
# - Beef will use enum classes in the Specification class located in the "Spv" namespace,
# e.g.: Spv.Specification.SourceLanguage.GLSL
#
# Some tokens act like mask values, which can be OR'd together,
# while others are mutually exclusive. The mask-like ones have
@@ -44,8 +46,8 @@
spv = {
'MagicNumber' : 0x07230203,
'Version' : 0x00010500,
'Revision' : 4,
'Version' : 0x00010600,
'Revision' : 1,
'OpCodeMask' : 0xffff,
'WordCountShift' : 16,
@@ -57,6 +59,7 @@ spv = {
'OpenCL_CPP' : 4,
'HLSL' : 5,
'CPP_for_OpenCL' : 6,
'SYCL' : 7,
},
'ExecutionModel' : {
@@ -167,6 +170,7 @@ spv = {
'NoGlobalOffsetINTEL' : 5895,
'NumSIMDWorkitemsINTEL' : 5896,
'SchedulerTargetFmaxMhzINTEL' : 5903,
'NamedBarrierCountINTEL' : 6417,
},
'StorageClass' : {
@@ -332,6 +336,7 @@ spv = {
'VolatileTexelKHR' : 11,
'SignExtend' : 12,
'ZeroExtend' : 13,
'Nontemporal' : 14,
'Offsets' : 16,
},
@@ -355,6 +360,7 @@ spv = {
'VolatileTexelKHR' : 0x00000800,
'SignExtend' : 0x00001000,
'ZeroExtend' : 0x00002000,
'Nontemporal' : 0x00004000,
'Offsets' : 0x00010000,
},
@@ -467,6 +473,7 @@ spv = {
'PerPrimitiveNV' : 5271,
'PerViewNV' : 5272,
'PerTaskNV' : 5273,
'PerVertexKHR' : 5285,
'PerVertexNV' : 5285,
'NonUniform' : 5300,
'NonUniformEXT' : 5300,
@@ -512,11 +519,14 @@ spv = {
'PrefetchINTEL' : 5902,
'StallEnableINTEL' : 5905,
'FuseLoopsInFunctionINTEL' : 5907,
'AliasScopeINTEL' : 5914,
'NoAliasINTEL' : 5915,
'BufferLocationINTEL' : 5921,
'IOPipeStorageINTEL' : 5944,
'FunctionFloatingPointModeINTEL' : 6080,
'SingleElementVectorINTEL' : 6085,
'VectorComputeCallableFunctionINTEL' : 6087,
'MediaBlockIOINTEL' : 6140,
},
'BuiltIn' : {
@@ -600,7 +610,9 @@ spv = {
'LayerPerViewNV' : 5279,
'MeshViewCountNV' : 5280,
'MeshViewIndicesNV' : 5281,
'BaryCoordKHR' : 5286,
'BaryCoordNV' : 5286,
'BaryCoordNoPerspKHR' : 5287,
'BaryCoordNoPerspNV' : 5287,
'FragSizeEXT' : 5292,
'FragmentSizeNV' : 5292,
@@ -639,6 +651,7 @@ spv = {
'SMCountNV' : 5375,
'WarpIDNV' : 5376,
'SMIDNV' : 5377,
'CullMaskKHR' : 6021,
},
'SelectionControlShift' : {
@@ -761,6 +774,8 @@ spv = {
'MakePointerVisibleKHR' : 4,
'NonPrivatePointer' : 5,
'NonPrivatePointerKHR' : 5,
'AliasScopeINTELMask' : 16,
'NoAliasINTELMask' : 17,
},
'MemoryAccessMask' : {
@@ -774,6 +789,8 @@ spv = {
'MakePointerVisibleKHR' : 0x00000010,
'NonPrivatePointer' : 0x00000020,
'NonPrivatePointerKHR' : 0x00000020,
'AliasScopeINTELMask' : 0x00010000,
'NoAliasINTELMask' : 0x00020000,
},
'Scope' : {
@@ -882,6 +899,7 @@ spv = {
'GroupNonUniformQuad' : 68,
'ShaderLayer' : 69,
'ShaderViewportIndex' : 70,
'UniformDecoration' : 71,
'FragmentShadingRateKHR' : 4422,
'SubgroupBallotKHR' : 4423,
'DrawParameters' : 4427,
@@ -930,6 +948,7 @@ spv = {
'FragmentFullyCoveredEXT' : 5265,
'MeshShadingNV' : 5266,
'ImageFootprintNV' : 5282,
'FragmentBarycentricKHR' : 5284,
'FragmentBarycentricNV' : 5284,
'ComputeDerivativeGroupQuadsNV' : 5288,
'FragmentDensityEXT' : 5291,
@@ -974,6 +993,7 @@ spv = {
'FragmentShaderShadingRateInterlockEXT' : 5372,
'ShaderSMBuiltinsNV' : 5373,
'FragmentShaderPixelInterlockEXT' : 5378,
'DemoteToHelperInvocation' : 5379,
'DemoteToHelperInvocationEXT' : 5379,
'BindlessTextureNV' : 5390,
'SubgroupShuffleINTEL' : 5568,
@@ -1008,23 +1028,32 @@ spv = {
'FPGAMemoryAccessesINTEL' : 5898,
'FPGAClusterAttributesINTEL' : 5904,
'LoopFuseINTEL' : 5906,
'MemoryAccessAliasingINTEL' : 5910,
'FPGABufferLocationINTEL' : 5920,
'ArbitraryPrecisionFixedPointINTEL' : 5922,
'USMStorageClassesINTEL' : 5935,
'IOPipesINTEL' : 5943,
'BlockingPipesINTEL' : 5945,
'FPGARegINTEL' : 5948,
'DotProductInputAll' : 6016,
'DotProductInputAllKHR' : 6016,
'DotProductInput4x8Bit' : 6017,
'DotProductInput4x8BitKHR' : 6017,
'DotProductInput4x8BitPacked' : 6018,
'DotProductInput4x8BitPackedKHR' : 6018,
'DotProduct' : 6019,
'DotProductKHR' : 6019,
'RayCullMaskKHR' : 6020,
'BitInstructions' : 6025,
'GroupNonUniformRotateKHR' : 6026,
'AtomicFloat32AddEXT' : 6033,
'AtomicFloat64AddEXT' : 6034,
'LongConstantCompositeINTEL' : 6089,
'OptNoneINTEL' : 6094,
'AtomicFloat16AddEXT' : 6095,
'DebugInfoModuleINTEL' : 6114,
'SplitBarrierINTEL' : 6141,
'GroupUniformArithmeticKHR' : 6400,
},
'RayFlagsShift' : {
@@ -1114,6 +1143,7 @@ spv = {
},
'PackedVectorFormat' : {
'PackedVectorFormat4x8Bit' : 0,
'PackedVectorFormat4x8BitKHR' : 0,
},
@@ -1468,17 +1498,24 @@ spv = {
'OpSubgroupAllKHR' : 4428,
'OpSubgroupAnyKHR' : 4429,
'OpSubgroupAllEqualKHR' : 4430,
'OpGroupNonUniformRotateKHR' : 4431,
'OpSubgroupReadInvocationKHR' : 4432,
'OpTraceRayKHR' : 4445,
'OpExecuteCallableKHR' : 4446,
'OpConvertUToAccelerationStructureKHR' : 4447,
'OpIgnoreIntersectionKHR' : 4448,
'OpTerminateRayKHR' : 4449,
'OpSDot' : 4450,
'OpSDotKHR' : 4450,
'OpUDot' : 4451,
'OpUDotKHR' : 4451,
'OpSUDot' : 4452,
'OpSUDotKHR' : 4452,
'OpSDotAccSat' : 4453,
'OpSDotAccSatKHR' : 4453,
'OpUDotAccSat' : 4454,
'OpUDotAccSatKHR' : 4454,
'OpSUDotAccSat' : 4455,
'OpSUDotAccSatKHR' : 4455,
'OpTypeRayQueryKHR' : 4472,
'OpRayQueryInitializeKHR' : 4473,
@@ -1518,6 +1555,7 @@ spv = {
'OpCooperativeMatrixLengthNV' : 5362,
'OpBeginInvocationInterlockEXT' : 5364,
'OpEndInvocationInterlockEXT' : 5365,
'OpDemoteToHelperInvocation' : 5380,
'OpDemoteToHelperInvocationEXT' : 5380,
'OpIsHelperInvocationEXT' : 5381,
'OpConvertUToImageNV' : 5391,
@@ -1727,6 +1765,9 @@ spv = {
'OpArbitraryFloatPowRINTEL' : 5881,
'OpArbitraryFloatPowNINTEL' : 5882,
'OpLoopControlINTEL' : 5887,
'OpAliasDomainDeclINTEL' : 5911,
'OpAliasScopeDeclINTEL' : 5912,
'OpAliasScopeListDeclINTEL' : 5913,
'OpFixedSqrtINTEL' : 5923,
'OpFixedRecipINTEL' : 5924,
'OpFixedRsqrtINTEL' : 5925,
@@ -1765,6 +1806,16 @@ spv = {
'OpTypeStructContinuedINTEL' : 6090,
'OpConstantCompositeContinuedINTEL' : 6091,
'OpSpecConstantCompositeContinuedINTEL' : 6092,
'OpControlBarrierArriveINTEL' : 6142,
'OpControlBarrierWaitINTEL' : 6143,
'OpGroupIMulKHR' : 6401,
'OpGroupFMulKHR' : 6402,
'OpGroupBitwiseAndKHR' : 6403,
'OpGroupBitwiseOrKHR' : 6404,
'OpGroupBitwiseXorKHR' : 6405,
'OpGroupLogicalAndKHR' : 6406,
'OpGroupLogicalOrKHR' : 6407,
'OpGroupLogicalXorKHR' : 6408,
},
}
@@ -31,7 +31,7 @@
/+
+ Enumeration tokens for SPIR-V, in various styles:
+ C, C++, C++11, JSON, Lua, Python, C#, D
+ C, C++, C++11, JSON, Lua, Python, C#, D, Beef
+
+ - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL
+ - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL
@@ -41,6 +41,8 @@
+ - C# will use enum classes in the Specification class located in the "Spv" namespace,
+ e.g.: Spv.Specification.SourceLanguage.GLSL
+ - D will have tokens under the "spv" module, e.g: spv.SourceLanguage.GLSL
+ - Beef will use enum classes in the Specification class located in the "Spv" namespace,
+ e.g.: Spv.Specification.SourceLanguage.GLSL
+
+ Some tokens act like mask values, which can be OR'd together,
+ while others are mutually exclusive. The mask-like ones have
@@ -51,8 +53,8 @@
module spv;
enum uint MagicNumber = 0x07230203;
enum uint Version = 0x00010500;
enum uint Revision = 4;
enum uint Version = 0x00010600;
enum uint Revision = 1;
enum uint OpCodeMask = 0xffff;
enum uint WordCountShift = 16;
@@ -65,6 +67,7 @@ enum SourceLanguage : uint
OpenCL_CPP = 4,
HLSL = 5,
CPP_for_OpenCL = 6,
SYCL = 7,
}
enum ExecutionModel : uint
@@ -179,6 +182,7 @@ enum ExecutionMode : uint
NoGlobalOffsetINTEL = 5895,
NumSIMDWorkitemsINTEL = 5896,
SchedulerTargetFmaxMhzINTEL = 5903,
NamedBarrierCountINTEL = 6417,
}
enum StorageClass : uint
@@ -352,6 +356,7 @@ enum ImageOperandsShift : uint
VolatileTexelKHR = 11,
SignExtend = 12,
ZeroExtend = 13,
Nontemporal = 14,
Offsets = 16,
}
@@ -376,6 +381,7 @@ enum ImageOperandsMask : uint
VolatileTexelKHR = 0x00000800,
SignExtend = 0x00001000,
ZeroExtend = 0x00002000,
Nontemporal = 0x00004000,
Offsets = 0x00010000,
}
@@ -495,6 +501,7 @@ enum Decoration : uint
PerPrimitiveNV = 5271,
PerViewNV = 5272,
PerTaskNV = 5273,
PerVertexKHR = 5285,
PerVertexNV = 5285,
NonUniform = 5300,
NonUniformEXT = 5300,
@@ -540,11 +547,14 @@ enum Decoration : uint
PrefetchINTEL = 5902,
StallEnableINTEL = 5905,
FuseLoopsInFunctionINTEL = 5907,
AliasScopeINTEL = 5914,
NoAliasINTEL = 5915,
BufferLocationINTEL = 5921,
IOPipeStorageINTEL = 5944,
FunctionFloatingPointModeINTEL = 6080,
SingleElementVectorINTEL = 6085,
VectorComputeCallableFunctionINTEL = 6087,
MediaBlockIOINTEL = 6140,
}
enum BuiltIn : uint
@@ -629,7 +639,9 @@ enum BuiltIn : uint
LayerPerViewNV = 5279,
MeshViewCountNV = 5280,
MeshViewIndicesNV = 5281,
BaryCoordKHR = 5286,
BaryCoordNV = 5286,
BaryCoordNoPerspKHR = 5287,
BaryCoordNoPerspNV = 5287,
FragSizeEXT = 5292,
FragmentSizeNV = 5292,
@@ -668,6 +680,7 @@ enum BuiltIn : uint
SMCountNV = 5375,
WarpIDNV = 5376,
SMIDNV = 5377,
CullMaskKHR = 6021,
}
enum SelectionControlShift : uint
@@ -799,6 +812,8 @@ enum MemoryAccessShift : uint
MakePointerVisibleKHR = 4,
NonPrivatePointer = 5,
NonPrivatePointerKHR = 5,
AliasScopeINTELMask = 16,
NoAliasINTELMask = 17,
}
enum MemoryAccessMask : uint
@@ -813,6 +828,8 @@ enum MemoryAccessMask : uint
MakePointerVisibleKHR = 0x00000010,
NonPrivatePointer = 0x00000020,
NonPrivatePointerKHR = 0x00000020,
AliasScopeINTELMask = 0x00010000,
NoAliasINTELMask = 0x00020000,
}
enum Scope : uint
@@ -927,6 +944,7 @@ enum Capability : uint
GroupNonUniformQuad = 68,
ShaderLayer = 69,
ShaderViewportIndex = 70,
UniformDecoration = 71,
FragmentShadingRateKHR = 4422,
SubgroupBallotKHR = 4423,
DrawParameters = 4427,
@@ -975,6 +993,7 @@ enum Capability : uint
FragmentFullyCoveredEXT = 5265,
MeshShadingNV = 5266,
ImageFootprintNV = 5282,
FragmentBarycentricKHR = 5284,
FragmentBarycentricNV = 5284,
ComputeDerivativeGroupQuadsNV = 5288,
FragmentDensityEXT = 5291,
@@ -1019,6 +1038,7 @@ enum Capability : uint
FragmentShaderShadingRateInterlockEXT = 5372,
ShaderSMBuiltinsNV = 5373,
FragmentShaderPixelInterlockEXT = 5378,
DemoteToHelperInvocation = 5379,
DemoteToHelperInvocationEXT = 5379,
BindlessTextureNV = 5390,
SubgroupShuffleINTEL = 5568,
@@ -1053,23 +1073,32 @@ enum Capability : uint
FPGAMemoryAccessesINTEL = 5898,
FPGAClusterAttributesINTEL = 5904,
LoopFuseINTEL = 5906,
MemoryAccessAliasingINTEL = 5910,
FPGABufferLocationINTEL = 5920,
ArbitraryPrecisionFixedPointINTEL = 5922,
USMStorageClassesINTEL = 5935,
IOPipesINTEL = 5943,
BlockingPipesINTEL = 5945,
FPGARegINTEL = 5948,
DotProductInputAll = 6016,
DotProductInputAllKHR = 6016,
DotProductInput4x8Bit = 6017,
DotProductInput4x8BitKHR = 6017,
DotProductInput4x8BitPacked = 6018,
DotProductInput4x8BitPackedKHR = 6018,
DotProduct = 6019,
DotProductKHR = 6019,
RayCullMaskKHR = 6020,
BitInstructions = 6025,
GroupNonUniformRotateKHR = 6026,
AtomicFloat32AddEXT = 6033,
AtomicFloat64AddEXT = 6034,
LongConstantCompositeINTEL = 6089,
OptNoneINTEL = 6094,
AtomicFloat16AddEXT = 6095,
DebugInfoModuleINTEL = 6114,
SplitBarrierINTEL = 6141,
GroupUniformArithmeticKHR = 6400,
}
enum RayFlagsShift : uint
@@ -1171,6 +1200,7 @@ enum OverflowModes : uint
enum PackedVectorFormat : uint
{
PackedVectorFormat4x8Bit = 0,
PackedVectorFormat4x8BitKHR = 0,
}
@@ -1526,17 +1556,24 @@ enum Op : uint
OpSubgroupAllKHR = 4428,
OpSubgroupAnyKHR = 4429,
OpSubgroupAllEqualKHR = 4430,
OpGroupNonUniformRotateKHR = 4431,
OpSubgroupReadInvocationKHR = 4432,
OpTraceRayKHR = 4445,
OpExecuteCallableKHR = 4446,
OpConvertUToAccelerationStructureKHR = 4447,
OpIgnoreIntersectionKHR = 4448,
OpTerminateRayKHR = 4449,
OpSDot = 4450,
OpSDotKHR = 4450,
OpUDot = 4451,
OpUDotKHR = 4451,
OpSUDot = 4452,
OpSUDotKHR = 4452,
OpSDotAccSat = 4453,
OpSDotAccSatKHR = 4453,
OpUDotAccSat = 4454,
OpUDotAccSatKHR = 4454,
OpSUDotAccSat = 4455,
OpSUDotAccSatKHR = 4455,
OpTypeRayQueryKHR = 4472,
OpRayQueryInitializeKHR = 4473,
@@ -1576,6 +1613,7 @@ enum Op : uint
OpCooperativeMatrixLengthNV = 5362,
OpBeginInvocationInterlockEXT = 5364,
OpEndInvocationInterlockEXT = 5365,
OpDemoteToHelperInvocation = 5380,
OpDemoteToHelperInvocationEXT = 5380,
OpIsHelperInvocationEXT = 5381,
OpConvertUToImageNV = 5391,
@@ -1785,6 +1823,9 @@ enum Op : uint
OpArbitraryFloatPowRINTEL = 5881,
OpArbitraryFloatPowNINTEL = 5882,
OpLoopControlINTEL = 5887,
OpAliasDomainDeclINTEL = 5911,
OpAliasScopeDeclINTEL = 5912,
OpAliasScopeListDeclINTEL = 5913,
OpFixedSqrtINTEL = 5923,
OpFixedRecipINTEL = 5924,
OpFixedRsqrtINTEL = 5925,
@@ -1823,6 +1864,16 @@ enum Op : uint
OpTypeStructContinuedINTEL = 6090,
OpConstantCompositeContinuedINTEL = 6091,
OpSpecConstantCompositeContinuedINTEL = 6092,
OpControlBarrierArriveINTEL = 6142,
OpControlBarrierWaitINTEL = 6143,
OpGroupIMulKHR = 6401,
OpGroupFMulKHR = 6402,
OpGroupBitwiseAndKHR = 6403,
OpGroupBitwiseOrKHR = 6404,
OpGroupBitwiseXorKHR = 6405,
OpGroupLogicalAndKHR = 6406,
OpGroupLogicalOrKHR = 6407,
OpGroupLogicalXorKHR = 6408,
}
@@ -69,9 +69,9 @@ namespace {
TPrinter();
static const int DocMagicNumber = 0x07230203;
static const int DocVersion = 0x00010500;
static const int DocRevision = 4;
#define DocRevisionString "4"
static const int DocVersion = 0x00010600;
static const int DocRevision = 1;
#define DocRevisionString "1"
static const std::string DocCopyright;
static const std::string DocComment1;
static const std::string DocComment2;
@@ -199,7 +199,7 @@ namespace {
const std::string TPrinter::DocComment2 =
"Enumeration tokens for SPIR-V, in various styles:\n"
" C, C++, C++11, JSON, Lua, Python, C#, D\n"
" C, C++, C++11, JSON, Lua, Python, C#, D, Beef\n"
"\n"
"- C will have tokens with a \"Spv\" prefix, e.g.: SpvSourceLanguageGLSL\n"
"- C++ will have tokens in the \"spv\" name space, e.g.: spv::SourceLanguageGLSL\n"
@@ -209,6 +209,8 @@ namespace {
"- C# will use enum classes in the Specification class located in the \"Spv\" namespace,\n"
" e.g.: Spv.Specification.SourceLanguage.GLSL\n"
"- D will have tokens under the \"spv\" module, e.g: spv.SourceLanguage.GLSL\n"
"- Beef will use enum classes in the Specification class located in the \"Spv\" namespace,\n"
" e.g.: Spv.Specification.SourceLanguage.GLSL\n"
"\n"
"Some tokens act like mask values, which can be OR'd together,\n"
"while others are mutually exclusive. The mask-like ones have\n"
@@ -513,6 +515,9 @@ namespace {
}
out << "#ifdef SPV_ENABLE_UTILITY_CODE" << std::endl;
out << "#ifndef __cplusplus" << std::endl;
out << "#include <stdbool.h>" << std::endl;
out << "#endif" << std::endl;
out << "inline void " << pre() << "HasResultAndType(" << pre() << opName << " opcode, bool *hasResult, bool *hasResultType) {" << std::endl;
out << " *hasResult = *hasResultType = false;" << std::endl;
out << " switch (opcode) {" << std::endl;
@@ -776,6 +781,43 @@ namespace {
}
};
// Beef printer
class TPrinterBeef final : public TPrinter {
private:
std::string commentBOL() const override { return "// "; }
void printPrologue(std::ostream& out) const override {
out << "namespace Spv\n{\n";
out << indent() << "using System;\n\n";
out << indent() << "public static class Specification\n";
out << indent() << "{\n";
}
void printEpilogue(std::ostream& out) const override {
out << indent() << "}\n";
out << "}\n";
}
std::string enumBeg(const std::string& s, enumStyle_t style) const override {
return indent(2) + "[AllowDuplicates, CRepr] public enum " + s + styleStr(style) + "\n" + indent(2) + "{\n";
}
std::string enumEnd(const std::string& s, enumStyle_t style, bool isLast) const override {
return indent(2) + "}" + +(isLast ? "\n" : "\n\n");
}
std::string enumFmt(const std::string& s, const valpair_t& v,
enumStyle_t style, bool isLast) const override {
return indent(3) + prependIfDigit(s, v.second) + " = " + fmtStyleVal(v.first, style) + ",\n";
}
std::string fmtConstInt(unsigned val, const std::string& name,
const char* fmt, bool isLast) const override {
return indent(2) + std::string("public const uint32 ") + name +
" = " + fmtNum(fmt, val) + (isLast ? ";\n\n" : ";\n");
}
};
} // namespace
namespace spv {
@@ -792,6 +834,7 @@ namespace spv {
langInfo.push_back(std::make_pair(ELangPython, "spirv.py"));
langInfo.push_back(std::make_pair(ELangCSharp, "spirv.cs"));
langInfo.push_back(std::make_pair(ELangD, "spv.d"));
langInfo.push_back(std::make_pair(ELangBeef, "spirv.bf"));
for (const auto& lang : langInfo) {
std::ofstream out(lang.second, std::ios::out);
@@ -819,6 +862,7 @@ namespace spv {
case ELangPython: p = TPrinterPtr(new TPrinterPython); break;
case ELangCSharp: p = TPrinterPtr(new TPrinterCSharp); break;
case ELangD: p = TPrinterPtr(new TPrinterD); break;
case ELangBeef: p = TPrinterPtr(new TPrinterBeef); break;
case ELangAll: PrintAllHeaders(); break;
default:
std::cerr << "Unknown language." << std::endl;
@@ -43,6 +43,7 @@ namespace spv {
ELangPython, // Python
ELangCSharp, // CSharp
ELangD, // D
ELangBeef, // Beef
ELangAll, // print headers in all languages to files
};
@@ -52,6 +52,7 @@ void Usage()
" Python - Python module (also accepts Py)\n"
" C# - C# module (also accepts CSharp)\n"
" D - D module\n"
" Beef - Beef module\n"
" -H print header in all supported languages to files in current directory\n"
);
}
@@ -96,6 +97,8 @@ bool ProcessArguments(int argc, char* argv[])
Language = spv::ELangCSharp;
} else if (language == "d") {
Language = spv::ELangD;
} else if (language == "beef") {
Language = spv::ELangBeef;
} else
return false;
+80 -114
View File
@@ -1,80 +1,69 @@
From 468f1935352773b5f9975cae8800ed148b0c8bf3 Mon Sep 17 00:00:00 2001
From: Benjamin Doherty <bendoherty@google.com>
Date: Tue, 2 Nov 2021 14:48:14 -0700
Subject: [PATCH] Filament specific changes
---
third_party/spirv-tools/CMakeLists.txt | 94 ++++++++++++-------
.../spirv-tools/external/CMakeLists.txt | 6 +-
.../external/spirv-headers/CMakeLists.txt | 8 +-
third_party/spirv-tools/source/CMakeLists.txt | 26 +++--
4 files changed, 86 insertions(+), 48 deletions(-)
diff --git a/third_party/spirv-tools/.gitignore b/third_party/spirv-tools/.gitignore
index ec709ba79..a87496a7d 100644
--- a/third_party/spirv-tools/.gitignore
+++ b/third_party/spirv-tools/.gitignore
@@ -5,8 +5,6 @@ compile_commands.json
/build*/
/buildtools/
/external/googletest
-/external/SPIRV-Headers
-/external/spirv-headers
/external/effcee
/external/re2
/external/protobuf
diff --git a/third_party/spirv-tools/CMakeLists.txt b/third_party/spirv-tools/CMakeLists.txt
index 70caf857a..3991bf660 100755
index 76b87d8c5..53b3404d1 100755
--- a/third_party/spirv-tools/CMakeLists.txt
+++ b/third_party/spirv-tools/CMakeLists.txt
@@ -24,8 +24,19 @@ if (POLICY CMP0054)
@@ -24,8 +24,14 @@ if (POLICY CMP0054)
endif()
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+# Filament specific changes
+if (APPLE)
+ set(CMAKE_MACOSX_RPATH ON)
+endif (APPLE)
+set(SPIRV_SKIP_EXECUTABLES_OPTION ON)
+set(SPIRV_SKIP_TESTS_OPTION ON)
+set(SKIP_SPIRV_TOOLS_INSTALL ON)
+# End Filament specific changes
+
project(spirv-tools)
-enable_testing()
+# Filament specific changes
+# enable_testing()
+# End Filament specific changes
set(SPIRV_TOOLS "SPIRV-Tools")
include(GNUInstallDirs)
@@ -71,7 +82,9 @@ if ("${CMAKE_BUILD_TYPE}" STREQUAL "")
@@ -71,7 +77,6 @@ if ("${CMAKE_BUILD_TYPE}" STREQUAL "")
set(CMAKE_BUILD_TYPE "Debug")
endif()
-option(SKIP_SPIRV_TOOLS_INSTALL "Skip installation" ${SKIP_SPIRV_TOOLS_INSTALL})
+# Filament specific changes
+# option(SKIP_SPIRV_TOOLS_INSTALL "Skip installation" ${SKIP_SPIRV_TOOLS_INSTALL})
+# End Filament specific changes
if(NOT ${SKIP_SPIRV_TOOLS_INSTALL})
set(ENABLE_SPIRV_TOOLS_INSTALL ON)
endif()
@@ -88,7 +101,10 @@ set(SPIRV_LIB_FUZZING_ENGINE_LINK_OPTIONS "" CACHE STRING "Used by OSS-Fuzz to c
@@ -88,7 +93,8 @@ set(SPIRV_LIB_FUZZING_ENGINE_LINK_OPTIONS "" CACHE STRING "Used by OSS-Fuzz to c
option(SPIRV_BUILD_LIBFUZZER_TARGETS "Build libFuzzer targets" OFF)
-option(SPIRV_WERROR "Enable error on warning" ON)
+# Filament specific changes
+# option(SPIRV_WERROR "Enable error on warning" ON)
+set(SPIRV_WERROR OFF)
+# End Filament specific changes
+
if(("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR (("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") AND (NOT CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")))
set(COMPILER_IS_LIKE_GNU TRUE)
endif()
@@ -243,7 +259,13 @@ if(NOT COMMAND find_host_program)
@@ -243,7 +249,12 @@ if(NOT COMMAND find_host_program)
endif()
# Tests require Python3
-find_host_package(PythonInterp 3 REQUIRED)
+# Filament specific changes
+if(CMAKE_VERSION VERSION_LESS "3.12" OR ${CMAKE_SYSTEM_NAME} MATCHES "Windows")
+ find_host_package(PythonInterp 3 REQUIRED)
+else()
+ find_package(Python3 COMPONENTS Interpreter)
+ set(PYTHON_EXECUTABLE "${Python3_EXECUTABLE}")
+endif()
+# End Filament specific changes
# Check for symbol exports on Linux.
# At the moment, this check will fail on the OSX build machines for the Android NDK.
@@ -286,11 +308,13 @@ if(ENABLE_SPIRV_TOOLS_INSTALL)
@@ -286,11 +297,13 @@ if(ENABLE_SPIRV_TOOLS_INSTALL)
endif()
# Defaults to OFF if the user didn't set it.
@@ -83,33 +72,33 @@ index 70caf857a..3991bf660 100755
- ${SPIRV_SKIP_EXECUTABLES})
-option(SPIRV_SKIP_TESTS
- "Skip building tests along with the library" ${SPIRV_SKIP_TESTS})
+# Filament specific changes
+ option(SPIRV_SKIP_EXECUTABLES
+ "Skip building the executable and tests along with the library"
+ ${SPIRV_SKIP_EXECUTABLES_OPTION})
+ option(SPIRV_SKIP_TESTS
+ "Skip building tests along with the library" ${SPIRV_SKIP_TESTS_OPTION})
+# End Filament specific changes
+
+
if ("${SPIRV_SKIP_EXECUTABLES}")
set(SPIRV_SKIP_TESTS ON)
endif()
@@ -334,8 +358,10 @@ endif()
@@ -334,9 +347,6 @@ endif()
add_subdirectory(source)
add_subdirectory(tools)
-add_subdirectory(test)
-add_subdirectory(examples)
+# Filament specific changes
+#add_subdirectory(test)
+#add_subdirectory(examples)
+# End Filament specific changes
-
if(ENABLE_SPIRV_TOOLS_INSTALL)
install(
@@ -360,28 +386,30 @@ set(SPIRV_SHARED_LIBRARIES "-lSPIRV-Tools-shared")
FILES
@@ -357,38 +367,3 @@ endif()
# Build pkg-config file
# Use a first-class target so it's regenerated when relevant files are updated.
set(SPIRV_LIBRARIES "-lSPIRV-Tools-opt -lSPIRV-Tools -lSPIRV-Tools-link")
set(SPIRV_SHARED_LIBRARIES "-lSPIRV-Tools-shared")
-
-# Build pkg-config file
-# Use a first-class target so it's regenerated when relevant files are updated.
-add_custom_target(spirv-tools-pkg-config ALL
- COMMAND ${CMAKE_COMMAND}
- -DCHANGES_FILE=${CMAKE_CURRENT_SOURCE_DIR}/CHANGES
@@ -132,75 +121,51 @@ index 70caf857a..3991bf660 100755
- -DSPIRV_SHARED_LIBRARIES=${SPIRV_SHARED_LIBRARIES}
- -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/write_pkg_config.cmake
- DEPENDS "CHANGES" "cmake/SPIRV-Tools-shared.pc.in" "cmake/write_pkg_config.cmake")
+# Filament specific changes
+# add_custom_target(spirv-tools-pkg-config ALL
+# COMMAND ${CMAKE_COMMAND}
+# -DCHANGES_FILE=${CMAKE_CURRENT_SOURCE_DIR}/CHANGES
+# -DTEMPLATE_FILE=${CMAKE_CURRENT_SOURCE_DIR}/cmake/SPIRV-Tools.pc.in
+# -DOUT_FILE=${CMAKE_CURRENT_BINARY_DIR}/SPIRV-Tools.pc
+# -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
+# -DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
+# -DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_INSTALL_INCLUDEDIR}
+# -DSPIRV_LIBRARIES=${SPIRV_LIBRARIES}
+# -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/write_pkg_config.cmake
+# DEPENDS "CHANGES" "cmake/SPIRV-Tools.pc.in" "cmake/write_pkg_config.cmake")
+# add_custom_target(spirv-tools-shared-pkg-config ALL
+# COMMAND ${CMAKE_COMMAND}
+# -DCHANGES_FILE=${CMAKE_CURRENT_SOURCE_DIR}/CHANGES
+# -DTEMPLATE_FILE=${CMAKE_CURRENT_SOURCE_DIR}/cmake/SPIRV-Tools-shared.pc.in
+# -DOUT_FILE=${CMAKE_CURRENT_BINARY_DIR}/SPIRV-Tools-shared.pc
+# -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
+# -DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
+# -DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_INSTALL_INCLUDEDIR}
+# -DSPIRV_SHARED_LIBRARIES=${SPIRV_SHARED_LIBRARIES}
+# -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/write_pkg_config.cmake
+# DEPENDS "CHANGES" "cmake/SPIRV-Tools-shared.pc.in" "cmake/write_pkg_config.cmake")
+# End Filament specific changes
-
-# Install pkg-config file
-if (ENABLE_SPIRV_TOOLS_INSTALL)
- install(
- FILES
- ${CMAKE_CURRENT_BINARY_DIR}/SPIRV-Tools.pc
- ${CMAKE_CURRENT_BINARY_DIR}/SPIRV-Tools-shared.pc
- DESTINATION
- ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
-endif()
diff --git a/third_party/spirv-tools/FILAMENT_README.md b/third_party/spirv-tools/FILAMENT_README.md
index 39e4620a0..3aa363ebf 100644
--- a/third_party/spirv-tools/FILAMENT_README.md
+++ b/third_party/spirv-tools/FILAMENT_README.md
@@ -1,9 +1,6 @@
-When updating spirv-tools to a new version, make sure to preserve all the changes marked with
-the following in `CMakeLists.txt` and `source/CMakeLists.txt`:
-
-`# Filament specific changes`
-
-You can easily apply these changes by running the following command at Filament's root:
+When updating spirv-tools to a new version there are several `CMakeLists.txt` files that need
+to patched with Filament specific changes. This can be done by running the following command at
+Filament's root:
# Install pkg-config file
if (ENABLE_SPIRV_TOOLS_INSTALL)
```
git apply third_party/spirv-tools/filament-specific-changes.patch
diff --git a/third_party/spirv-tools/external/CMakeLists.txt b/third_party/spirv-tools/external/CMakeLists.txt
index 179a4012f..152cfc421 100644
index 179a4012f..a081e119b 100644
--- a/third_party/spirv-tools/external/CMakeLists.txt
+++ b/third_party/spirv-tools/external/CMakeLists.txt
@@ -45,8 +45,10 @@ if (IS_DIRECTORY ${SPIRV_HEADER_DIR})
@@ -45,8 +45,6 @@ if (IS_DIRECTORY ${SPIRV_HEADER_DIR})
# Do this so enclosing projects can use SPIRV-Headers_SOURCE_DIR to find
# headers to include.
if (NOT DEFINED SPIRV-Headers_SOURCE_DIR)
- set(SPIRV_HEADERS_SKIP_INSTALL ON)
- set(SPIRV_HEADERS_SKIP_EXAMPLES ON)
+# Filament specific changes
+ #set(SPIRV_HEADERS_SKIP_INSTALL ON)
+ #set(SPIRV_HEADERS_SKIP_EXAMPLES ON)
+# End Filament specific changes
add_subdirectory(${SPIRV_HEADER_DIR})
endif()
else()
diff --git a/third_party/spirv-tools/external/spirv-headers/CMakeLists.txt b/third_party/spirv-tools/external/spirv-headers/CMakeLists.txt
index c11150008..1a1fe9548 100644
--- a/third_party/spirv-tools/external/spirv-headers/CMakeLists.txt
+++ b/third_party/spirv-tools/external/spirv-headers/CMakeLists.txt
@@ -49,11 +49,11 @@ add_custom_target(install-headers
COMMAND cmake -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/include/spirv
$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/include/spirv)
-option(SPIRV_HEADERS_SKIP_EXAMPLES "Skip building examples"
- ${SPIRV_HEADERS_SKIP_EXAMPLES})
+# Filament specific changes
+option(SPIRV_HEADERS_SKIP_EXAMPLES "Skip building examples" ON)
-option(SPIRV_HEADERS_SKIP_INSTALL "Skip install"
- ${SPIRV_HEADERS_SKIP_INSTALL})
+option(SPIRV_HEADERS_SKIP_INSTALL "Skip install" ON)
+# End Filament specific changes
if(NOT ${SPIRV_HEADERS_SKIP_EXAMPLES})
set(SPIRV_HEADERS_ENABLE_EXAMPLES ON)
diff --git a/third_party/spirv-tools/source/CMakeLists.txt b/third_party/spirv-tools/source/CMakeLists.txt
index 331ff6755..ef6eb8e77 100644
index 98559b8fe..0734d6a82 100644
--- a/third_party/spirv-tools/source/CMakeLists.txt
+++ b/third_party/spirv-tools/source/CMakeLists.txt
@@ -371,13 +371,15 @@ endfunction()
@@ -374,13 +374,6 @@ endfunction()
# Always build ${SPIRV_TOOLS}-shared. This is expected distro packages, and
# unlike the other SPIRV_TOOLS target, defaults to hidden symbol visibility.
@@ -211,38 +176,39 @@ index 331ff6755..ef6eb8e77 100644
- PRIVATE SPIRV_TOOLS_IMPLEMENTATION
- PUBLIC SPIRV_TOOLS_SHAREDLIB
-)
+# Filament specific changes
+# add_library(${SPIRV_TOOLS}-shared SHARED ${SPIRV_SOURCES})
+# spirv_tools_default_target_options(${SPIRV_TOOLS}-shared)
+# set_target_properties(${SPIRV_TOOLS}-shared PROPERTIES CXX_VISIBILITY_PRESET hidden)
+# target_compile_definitions(${SPIRV_TOOLS}-shared
+# PRIVATE SPIRV_TOOLS_IMPLEMENTATION
+# PUBLIC SPIRV_TOOLS_SHAREDLIB
+# )
+# End Filament specific changes
if(SPIRV_TOOLS_BUILD_STATIC)
add_library(${SPIRV_TOOLS}-static STATIC ${SPIRV_SOURCES})
@@ -393,11 +395,17 @@ if(SPIRV_TOOLS_BUILD_STATIC)
@@ -396,11 +389,11 @@ if(SPIRV_TOOLS_BUILD_STATIC)
add_library(${SPIRV_TOOLS} ALIAS ${SPIRV_TOOLS}-static)
endif()
- set(SPIRV_TOOLS_TARGETS ${SPIRV_TOOLS}-static ${SPIRV_TOOLS}-shared)
+# Filament specific changes
+ # set(SPIRV_TOOLS_TARGETS ${SPIRV_TOOLS}-static ${SPIRV_TOOLS}-shared)
+ set(SPIRV_TOOLS_TARGETS ${SPIRV_TOOLS}-static)
+# End Filament specific changes
else()
add_library(${SPIRV_TOOLS} ${SPIRV_TOOLS_LIBRARY_TYPE} ${SPIRV_SOURCES})
spirv_tools_default_target_options(${SPIRV_TOOLS})
- set(SPIRV_TOOLS_TARGETS ${SPIRV_TOOLS} ${SPIRV_TOOLS}-shared)
+# Filament specific changes
+ # set(SPIRV_TOOLS_TARGETS ${SPIRV_TOOLS} ${SPIRV_TOOLS}-shared)
+ set(SPIRV_TOOLS_TARGETS ${SPIRV_TOOLS})
+# End Filament specific changes
endif()
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
--
2.33.1.1089.g2158813163f-goog
diff --git a/third_party/spirv-tools/external/spirv-headers/CMakeLists.txt b/third_party/spirv-tools/external/spirv-headers/CMakeLists.txt
index 147f7adee..d8d1d7e35 100644
--- a/third_party/spirv-tools/external/spirv-headers/CMakeLists.txt
+++ b/third_party/spirv-tools/external/spirv-headers/CMakeLists.txt
@@ -49,11 +49,9 @@ add_custom_target(install-headers
COMMAND cmake -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/include/spirv
$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/include/spirv)
-option(SPIRV_HEADERS_SKIP_EXAMPLES "Skip building examples"
- ${SPIRV_HEADERS_SKIP_EXAMPLES})
+option(SPIRV_HEADERS_SKIP_EXAMPLES "Skip building examples" ON)
-option(SPIRV_HEADERS_SKIP_INSTALL "Skip install"
- ${SPIRV_HEADERS_SKIP_INSTALL})
+option(SPIRV_HEADERS_SKIP_INSTALL "Skip install" ON)
if(NOT ${SPIRV_HEADERS_SKIP_EXAMPLES})
set(SPIRV_HEADERS_ENABLE_EXAMPLES ON)
+9 -4
View File
@@ -482,6 +482,7 @@ SPIRV_TOOLS_EXPORT const char* spvSoftwareVersionDetailsString(void);
// SPV_ENV_VULKAN_1_1 -> SPIR-V 1.3
// SPV_ENV_VULKAN_1_1_SPIRV_1_4 -> SPIR-V 1.4
// SPV_ENV_VULKAN_1_2 -> SPIR-V 1.5
// SPV_ENV_VULKAN_1_3 -> SPIR-V 1.6
// Consult the description of API entry points for specific rules.
typedef enum {
SPV_ENV_UNIVERSAL_1_0, // SPIR-V 1.0 latest revision, no other restrictions.
@@ -516,7 +517,11 @@ typedef enum {
SPV_ENV_UNIVERSAL_1_5, // SPIR-V 1.5 latest revision, no other restrictions.
SPV_ENV_VULKAN_1_2, // Vulkan 1.2 latest revision.
SPV_ENV_MAX // Keep this as the last enum value.
SPV_ENV_UNIVERSAL_1_6, // SPIR-V 1.6 latest revision, no other restrictions.
SPV_ENV_VULKAN_1_3, // Vulkan 1.3 latest revision.
SPV_ENV_MAX // Keep this as the last enum value.
} spv_target_env;
// SPIR-V Validator can be parameterized with the following Universal Limits.
@@ -555,7 +560,7 @@ SPIRV_TOOLS_EXPORT bool spvParseVulkanEnv(uint32_t vulkan_ver,
// Creates a context object for most of the SPIRV-Tools API.
// Returns null if env is invalid.
//
// See specific API calls for how the target environment is interpeted
// See specific API calls for how the target environment is interpreted
// (particularly assembly and validation).
SPIRV_TOOLS_EXPORT spv_context spvContextCreate(spv_target_env env);
@@ -607,7 +612,7 @@ SPIRV_TOOLS_EXPORT void spvValidatorOptionsSetRelaxLogicalPointer(
// set that option.
// 2) Pointers that are pass as parameters to function calls do not have to
// match the storage class of the formal parameter.
// 3) Pointers that are actaul parameters on function calls do not have to point
// 3) Pointers that are actual parameters on function calls do not have to point
// to the same type pointed as the formal parameter. The types just need to
// logically match.
// 4) GLSLstd450 Interpolate* instructions can have a load of an interpolant
@@ -633,7 +638,7 @@ SPIRV_TOOLS_EXPORT void spvValidatorOptionsSetUniformBufferStandardLayout(
// Records whether the validator should use "scalar" block layout rules.
// Scalar layout rules are more permissive than relaxed block layout.
//
// See Vulkan extnesion VK_EXT_scalar_block_layout. The scalar alignment is
// See Vulkan extension VK_EXT_scalar_block_layout. The scalar alignment is
// defined as follows:
// - scalar alignment of a scalar is the scalar size
// - scalar alignment of a vector is the scalar alignment of its component
+2 -2
View File
@@ -36,7 +36,7 @@ class Context {
public:
// Constructs a context targeting the given environment |env|.
//
// See specific API calls for how the target environment is interpeted
// See specific API calls for how the target environment is interpreted
// (particularly assembly and validation).
//
// The constructed instance will have an empty message consumer, which just
@@ -139,7 +139,7 @@ class ValidatorOptions {
// set that option.
// 2) Pointers that are pass as parameters to function calls do not have to
// match the storage class of the formal parameter.
// 3) Pointers that are actaul parameters on function calls do not have to
// 3) Pointers that are actual parameters on function calls do not have to
// point to the same type pointed as the formal parameter. The types just
// need to logically match.
// 4) GLSLstd450 Interpolate* instructions can have a load of an interpolant

Some files were not shown because too many files have changed in this diff Show More