summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2017-11-04 18:43:26 -0400
committerYong He <yonghe@outlook.com>2017-11-04 18:43:26 -0400
commita4fabfc85527bd4807a603dcde7c0a3762b11136 (patch)
treefd7201b0ce9938081c4bde1f9e79ec646056ed02
parent00e03825d80c4997fa35461d82ff267f721ae8a6 (diff)
parent215ce206838db63fdd310a0ababe421799011d21 (diff)
Merge remote-tracking branch 'refs/remotes/official/master'
-rw-r--r--source/slang-glslang/slang-glslang.vcxproj4
-rw-r--r--source/slang/bytecode.cpp34
-rw-r--r--source/slang/ir.cpp2
-rw-r--r--tools/render-test/render-d3d11.cpp6
4 files changed, 25 insertions, 21 deletions
diff --git a/source/slang-glslang/slang-glslang.vcxproj b/source/slang-glslang/slang-glslang.vcxproj
index be617f363..068854eba 100644
--- a/source/slang-glslang/slang-glslang.vcxproj
+++ b/source/slang-glslang/slang-glslang.vcxproj
@@ -97,6 +97,7 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>NV_EXTENSIONS;AMD_EXTENSIONS;WIN32;_DEBUG;_WINDOWS;_USRDLL;GLSLANG_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <DisableSpecificWarnings>4819;4267</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@@ -110,6 +111,7 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>NV_EXTENSIONS;AMD_EXTENSIONS;_DEBUG;_WINDOWS;_USRDLL;GLSLANG_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <DisableSpecificWarnings>4819;4267</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@@ -125,6 +127,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>NV_EXTENSIONS;AMD_EXTENSIONS;WIN32;NDEBUG;_WINDOWS;_USRDLL;GLSLANG_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <DisableSpecificWarnings>4819;4267</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@@ -142,6 +145,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>NV_EXTENSIONS;AMD_EXTENSIONS;NDEBUG;_WINDOWS;_USRDLL;GLSLANG_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <DisableSpecificWarnings>4819;4267</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
diff --git a/source/slang/bytecode.cpp b/source/slang/bytecode.cpp
index e3cd9e74e..943a9a5a3 100644
--- a/source/slang/bytecode.cpp
+++ b/source/slang/bytecode.cpp
@@ -156,7 +156,7 @@ BCPtr<void>::RawVal allocateRaw(
for(size_t ii = currentOffset; ii < endOffset; ++ii)
context->shared->bytecode.Add(0);
- return beginOffset;
+ return (BCPtr<void>::RawVal)beginOffset;
}
template<typename T>
@@ -258,7 +258,7 @@ BCConst getGlobalValue(
BCConst bcConst;
bcConst.flavor = kBCConstFlavor_Constant;
- bcConst.id = constID;
+ bcConst.id = (uint32_t)constID;
context->shared->mapValueToGlobal.Add(value, bcConst);
@@ -481,7 +481,7 @@ BytecodeGenerationPtr<BCType> emitBCType(
auto bcArgs = (bcType + 1).bitCast<BCPtr<uint8_t>>();
bcType->op = op;
- bcType->argCount = argCount;
+ bcType->argCount = (uint32_t)argCount;
for(UInt aa = 0; aa < argCount; ++aa)
{
@@ -491,7 +491,7 @@ BytecodeGenerationPtr<BCType> emitBCType(
UInt id = context->shared->bcTypes.Count();
context->shared->mapTypeToID.Add(type, id);
context->shared->bcTypes.Add(bcType);
- bcType->id = id;
+ bcType->id = (uint32_t)id;
return bcType;
}
@@ -705,7 +705,7 @@ BytecodeGenerationPtr<BCSymbol> generateBytecodeSymbolForInst(
// Allocate the array of block objects to be stored in the
// bytecode file.
auto bcBlocks = allocateArray<BCBlock>(context, blockCount);
- bcFunc->blockCount = blockCount;
+ bcFunc->blockCount = (uint32_t)blockCount;
bcFunc->blocks = bcBlocks;
// Now loop through the blocks again, and allocate the storage
@@ -752,7 +752,7 @@ BytecodeGenerationPtr<BCSymbol> generateBytecodeSymbolForInst(
}
}
- bcBlocks[blockID].paramCount = paramCount;
+ bcBlocks[blockID].paramCount = (uint32_t)paramCount;
}
// Okay, we've counted how many registers we need for each block,
@@ -760,7 +760,7 @@ BytecodeGenerationPtr<BCSymbol> generateBytecodeSymbolForInst(
UInt regCount = regCounter;
auto bcRegs = allocateArray<BCReg>(context, regCount);
- bcFunc->regCount = regCount;
+ bcFunc->regCount = (uint32_t)regCount;
bcFunc->regs = bcRegs;
// Now we will loop over things again to fill in the information
@@ -788,7 +788,7 @@ BytecodeGenerationPtr<BCSymbol> generateBytecodeSymbolForInst(
#if 0
bcRegs[localID].name = tryGenerateNameForSymbol(context, pp);
#endif
- bcRegs[localID].previousVarIndexPlusOne = localID;
+ bcRegs[localID].previousVarIndexPlusOne = (uint32_t)localID;
bcRegs[localID].typeID = getTypeIDForGlobalSymbol(context, pp);
}
@@ -810,7 +810,7 @@ BytecodeGenerationPtr<BCSymbol> generateBytecodeSymbolForInst(
#if 0
bcRegs[localID].name = tryGenerateNameForSymbol(context, ii);
#endif
- bcRegs[localID].previousVarIndexPlusOne = localID;
+ bcRegs[localID].previousVarIndexPlusOne = (uint32_t)localID;
bcRegs[localID].typeID = getTypeIDForGlobalSymbol(context, ii);
}
break;
@@ -830,11 +830,11 @@ BytecodeGenerationPtr<BCSymbol> generateBytecodeSymbolForInst(
#if 0
bcRegs[localID].name = tryGenerateNameForSymbol(context, ii);
#endif
- bcRegs[localID].previousVarIndexPlusOne = localID;
+ bcRegs[localID].previousVarIndexPlusOne = (uint32_t)localID;
bcRegs[localID].typeID = getTypeIDForGlobalSymbol(context, ii);
bcRegs[localID+1].op = ii->op;
- bcRegs[localID+1].previousVarIndexPlusOne = localID+1;
+ bcRegs[localID+1].previousVarIndexPlusOne = (uint32_t)localID+1;
bcRegs[localID+1].typeID = getTypeID(context,
(ii->getType()->As<PtrType>())->getValueType());
}
@@ -905,7 +905,7 @@ BytecodeGenerationPtr<BCSymbol> generateBytecodeSymbolForInst(
UInt constCount = subContext->remappedGlobalSymbols.Count();
auto bcConsts = allocateArray<BCConst>(context, constCount);
- bcFunc->constCount = constCount;
+ bcFunc->constCount = (uint32_t)constCount;
bcFunc->consts = bcConsts;
for( UInt cc = 0; cc < constCount; ++cc )
@@ -971,7 +971,7 @@ BytecodeGenerationPtr<BCModule> generateBytecodeForModule(
// Ensure that local code inside functions can see these symbols
BCConst bcConst;
bcConst.flavor = kBCConstFlavor_GlobalSymbol;
- bcConst.id = globalID;
+ bcConst.id = (uint32_t)globalID;
context->shared->mapValueToGlobal.Add(gv, bcConst);
// In the global scope, global IDs are also the local IDs
@@ -980,7 +980,7 @@ BytecodeGenerationPtr<BCModule> generateBytecodeForModule(
auto bcSymbols = allocateArray<BCPtr<BCSymbol>>(context, symbolCount);
- bcModule->symbolCount = symbolCount;
+ bcModule->symbolCount = (uint32_t)symbolCount;
bcModule->symbols = bcSymbols;
for( auto gv = irModule->getFirstGlobalValue(); gv; gv = gv->getNextValue() )
@@ -1000,7 +1000,7 @@ BytecodeGenerationPtr<BCModule> generateBytecodeForModule(
// At this point we should have identified all the literals we need:
UInt constantCount = context->shared->constants.Count();
auto bcConstants = allocateArray<BCConstant>(context, constantCount);
- bcModule->constantCount = constantCount;
+ bcModule->constantCount = (uint32_t)constantCount;
bcModule->constants = bcConstants;
for(UInt cc = 0; cc < constantCount; ++cc)
@@ -1028,7 +1028,7 @@ BytecodeGenerationPtr<BCModule> generateBytecodeForModule(
// At this point we should have collected all the types we need:
UInt typeCount = context->shared->bcTypes.Count();
auto bcTypes = allocateArray<BCPtr<BCType>>(context, typeCount);
- bcModule->typeCount = typeCount;
+ bcModule->typeCount = (uint32_t)typeCount;
bcModule->types = bcTypes;
for(UInt tt = 0; tt < typeCount; ++tt)
@@ -1065,7 +1065,7 @@ void generateBytecodeContainer(
}
UInt bcModuleCount = bcModulesList.Count();
- header->moduleCount = bcModuleCount;
+ header->moduleCount = (uint32_t)bcModuleCount;
auto bcModules = allocateArray<BCPtr<BCModule>>(context, bcModuleCount);
header->modules = bcModules;
diff --git a/source/slang/ir.cpp b/source/slang/ir.cpp
index e424b4cc3..04569771a 100644
--- a/source/slang/ir.cpp
+++ b/source/slang/ir.cpp
@@ -260,7 +260,7 @@ namespace Slang
IRInst* inst = (IRInst*) malloc(size);
memset(inst, 0, size);
- inst->argCount = fixedArgCount + varArgCount;
+ inst->argCount = (uint32_t)(fixedArgCount + varArgCount);
inst->op = op;
diff --git a/tools/render-test/render-d3d11.cpp b/tools/render-test/render-d3d11.cpp
index 47f486a0d..c5c3f68b8 100644
--- a/tools/render-test/render-d3d11.cpp
+++ b/tools/render-test/render-d3d11.cpp
@@ -394,7 +394,7 @@ public:
}
dxImmediateContext->OMSetRenderTargets(
- dxRenderTargetViews.Count(),
+ (UINT)dxRenderTargetViews.Count(),
dxRenderTargetViews.Buffer(),
NULL);
@@ -772,7 +772,7 @@ public:
{
auto dxContext = dxImmediateContext;
D3D11_BUFFER_DESC desc = {0};
- desc.ByteWidth = bufferData.Count() * sizeof(unsigned int);
+ desc.ByteWidth = (UINT)(bufferData.Count() * sizeof(unsigned int));
if (bufferDesc.type == InputBufferType::ConstantBuffer)
{
desc.Usage = D3D11_USAGE_DEFAULT;
@@ -966,7 +966,7 @@ public:
case ShaderInputType::Buffer:
{
createInputBuffer(entry.bufferDesc, entry.bufferData, rsEntry.buffer, rsEntry.uav, rsEntry.srv);
- rsEntry.bufferLength = entry.bufferData.Count() * sizeof(unsigned int);
+ rsEntry.bufferLength = (int)(entry.bufferData.Count() * sizeof(unsigned int));
}
break;
case ShaderInputType::Texture: