MCPcopy Create free account
hub / github.com/crownengine/crown / patchUAVRegisterDebugInfo

Function patchUAVRegisterDebugInfo

3rdparty/bgfx/src/renderer_d3d11.cpp:4071–4105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4069 }
4070
4071 static void patchUAVRegisterDebugInfo(DxbcSPDB& _spdb)
4072 {
4073 if (!_spdb.debugCode.empty())
4074 {
4075 // 'register( u[xx] )'
4076 char* ptr = (char*)_spdb.debugCode.data();
4077 while (ptr < (char*)_spdb.debugCode.data() + _spdb.debugCode.size() - 3)
4078 {
4079 if (*(ptr+1) == ' '
4080 && *(ptr+2) == 'u'
4081 && *(ptr+3) == '[')
4082 {
4083 char* startPtr = ptr+4;
4084 char* endPtr = ptr+4;
4085
4086 while (*endPtr != ']')
4087 {
4088 endPtr++;
4089 }
4090
4091 uint32_t regNum = 0;
4092 uint32_t regLen = uint32_t(endPtr - startPtr);
4093 bx::fromString(&regNum, bx::StringView(startPtr, regLen));
4094
4095 regNum += 16;
4096 uint32_t len = bx::toString(startPtr, regLen+2, regNum);
4097 *(startPtr + len) = ']';
4098
4099 break;
4100 }
4101
4102 ++ptr;
4103 }
4104 }
4105 }
4106
4107 void ShaderD3D11::create(const Memory* _mem)
4108 {

Callers 1

createMethod · 0.85

Calls 6

fromStringFunction · 0.85
toStringFunction · 0.70
StringViewClass · 0.50
emptyMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected