diff options
| author | lucy96chen <47800040+lucy96chen@users.noreply.github.com> | 2022-04-21 12:59:09 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-21 12:59:09 -0700 |
| commit | f493d24c70a6227754296439e97adf35ec412496 (patch) | |
| tree | 25fffb03c067477bef68ccdc66865683159e3ab5 /tools/gfx-util | |
| parent | 1b6cea2219307f6271e131c43d6e8f48910bd435 (diff) | |
GFX renaming work part 2: slang-gfx.h renames (#2194)
* Fixed all build errors and type conversion warnings from renames in slang-gfx.h
* Made necessary build fixes to the CUDA implementation
* Renamed ITextureResource::Size to ITextureResource::Extents
* More rename changes based on CI errors
* More renames to fix CI build errors
* Rerun tests
Diffstat (limited to 'tools/gfx-util')
| -rw-r--r-- | tools/gfx-util/shader-cursor.cpp | 14 | ||||
| -rw-r--r-- | tools/gfx-util/shader-cursor.h | 22 |
2 files changed, 18 insertions, 18 deletions
diff --git a/tools/gfx-util/shader-cursor.cpp b/tools/gfx-util/shader-cursor.cpp index efdde44b8..5a2cdfd33 100644 --- a/tools/gfx-util/shader-cursor.cpp +++ b/tools/gfx-util/shader-cursor.cpp @@ -66,7 +66,7 @@ Result ShaderCursor::getField(const char* name, const char* nameEnd, ShaderCurso // fieldCursor.m_offset.uniformOffset = m_offset.uniformOffset + fieldLayout->getOffset(); fieldCursor.m_offset.bindingRangeIndex = - m_offset.bindingRangeIndex + m_typeLayout->getFieldBindingRangeOffset(fieldIndex); + m_offset.bindingRangeIndex + (GfxIndex)m_typeLayout->getFieldBindingRangeOffset(fieldIndex); // The index of the field within any binding ranges will be the same // as the index computed for the parent structure. @@ -126,8 +126,8 @@ Result ShaderCursor::getField(const char* name, const char* nameEnd, ShaderCurso // // TODO: figure out whether we should support this long-term. // - auto entryPointCount = (gfx::Int) m_baseObject->getEntryPointCount(); - for( gfx::Int e = 0; e < entryPointCount; ++e ) + auto entryPointCount = (GfxIndex) m_baseObject->getEntryPointCount(); + for( GfxIndex e = 0; e < entryPointCount; ++e ) { ComPtr<IShaderObject> entryPoint; m_baseObject->getEntryPoint(e, entryPoint.writeRef()); @@ -142,7 +142,7 @@ Result ShaderCursor::getField(const char* name, const char* nameEnd, ShaderCurso return SLANG_E_INVALID_ARG; } -ShaderCursor ShaderCursor::getElement(SlangInt index) const +ShaderCursor ShaderCursor::getElement(GfxIndex index) const { if (m_containerType != ShaderObjectContainerType::None) { @@ -168,7 +168,7 @@ ShaderCursor ShaderCursor::getElement(SlangInt index) const index * m_typeLayout->getElementStride(SLANG_PARAMETER_CATEGORY_UNIFORM); elementCursor.m_offset.bindingRangeIndex = m_offset.bindingRangeIndex; elementCursor.m_offset.bindingArrayIndex = - m_offset.bindingArrayIndex * m_typeLayout->getElementCount() + index; + m_offset.bindingArrayIndex * (GfxCount)m_typeLayout->getElementCount() + index; return elementCursor; } break; @@ -189,7 +189,7 @@ ShaderCursor ShaderCursor::getElement(SlangInt index) const fieldCursor.m_typeLayout = fieldLayout->getTypeLayout(); fieldCursor.m_offset.uniformOffset = m_offset.uniformOffset + fieldLayout->getOffset(); fieldCursor.m_offset.bindingRangeIndex = - m_offset.bindingRangeIndex + m_typeLayout->getFieldBindingRangeOffset(fieldIndex); + m_offset.bindingRangeIndex + (GfxIndex)m_typeLayout->getFieldBindingRangeOffset(fieldIndex); fieldCursor.m_offset.bindingArrayIndex = m_offset.bindingArrayIndex; return fieldCursor; @@ -266,7 +266,7 @@ Result ShaderCursor::followPath(const char* path, ShaderCursor& ioCursor) return SLANG_E_INVALID_ARG; _get(rest); - SlangInt index = 0; + GfxCount index = 0; while (_peek(rest) != ']') { int d = _get(rest); diff --git a/tools/gfx-util/shader-cursor.h b/tools/gfx-util/shader-cursor.h index 4c281c99a..5dfc57f6d 100644 --- a/tools/gfx-util/shader-cursor.h +++ b/tools/gfx-util/shader-cursor.h @@ -63,7 +63,7 @@ struct ShaderCursor return cursor; } - ShaderCursor getElement(SlangInt index) const; + ShaderCursor getElement(GfxIndex index) const; static Result followPath(const char* path, ShaderCursor& ioCursor); @@ -82,7 +82,7 @@ struct ShaderCursor , m_containerType(object->getContainerType()) {} - SlangResult setData(void const* data, size_t size) const + SlangResult setData(void const* data, Size size) const { return m_baseObject->setData(m_offset, data, size); } @@ -98,7 +98,7 @@ struct ShaderCursor return m_baseObject->setObject(m_offset, object); } - SlangResult setSpecializationArgs(const slang::SpecializationArg* args, uint32_t count) const + SlangResult setSpecializationArgs(const slang::SpecializationArg* args, GfxCount count) const { return m_baseObject->setSpecializationArgs(m_offset, args, count); } @@ -129,13 +129,13 @@ struct ShaderCursor /// Produce a cursor to the element or field with the given `index`. /// /// This is a convenience wrapper around `getElement()`. - ShaderCursor operator[](int64_t index) const { return getElement((SlangInt)index); } - ShaderCursor operator[](uint64_t index) const { return getElement((SlangInt)index); } - ShaderCursor operator[](int32_t index) const { return getElement((SlangInt)index); } - ShaderCursor operator[](uint32_t index) const { return getElement((SlangInt)index); } - ShaderCursor operator[](int16_t index) const { return getElement((SlangInt)index); } - ShaderCursor operator[](uint16_t index) const { return getElement((SlangInt)index); } - ShaderCursor operator[](int8_t index) const { return getElement((SlangInt)index); } - ShaderCursor operator[](uint8_t index) const { return getElement((SlangInt)index); } + ShaderCursor operator[](int64_t index) const { return getElement((GfxIndex)index); } + ShaderCursor operator[](uint64_t index) const { return getElement((GfxIndex)index); } + ShaderCursor operator[](int32_t index) const { return getElement((GfxIndex)index); } + ShaderCursor operator[](uint32_t index) const { return getElement((GfxIndex)index); } + ShaderCursor operator[](int16_t index) const { return getElement((GfxIndex)index); } + ShaderCursor operator[](uint16_t index) const { return getElement((GfxIndex)index); } + ShaderCursor operator[](int8_t index) const { return getElement((GfxIndex)index); } + ShaderCursor operator[](uint8_t index) const { return getElement((GfxIndex)index); } }; } |
