Fixes based on https://github.com/Unity-Technologies/HLSLcc/pull/2
This commit is contained in:
parent
117eb98b61
commit
23cd014fd4
@ -72,12 +72,13 @@ void HLSLCrossCompilerContext::ClearDependencyData()
|
||||
case PIXEL_SHADER:
|
||||
{
|
||||
psDependencies->ClearCrossDependencyData();
|
||||
break;
|
||||
}
|
||||
case HULL_SHADER:
|
||||
{
|
||||
psDependencies->eTessPartitioning = TESSELLATOR_PARTITIONING_UNDEFINED;
|
||||
psDependencies->eTessOutPrim = TESSELLATOR_OUTPUT_UNDEFINED;
|
||||
break;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
|
@ -62,7 +62,16 @@ HLSLCC_API int HLSLCC_APIENTRY TranslateHLSLFromMem(const char* shader,
|
||||
|
||||
sContext.psShader = psShader.get();
|
||||
sContext.flags = flags;
|
||||
sContext.psDependencies = dependencies;
|
||||
|
||||
// If dependencies == NULL, we'll create a dummy object for it so that there's always something there.
|
||||
std::auto_ptr<GLSLCrossDependencyData> depPtr(NULL);
|
||||
if (dependencies == NULL)
|
||||
{
|
||||
depPtr.reset(new GLSLCrossDependencyData());
|
||||
sContext.psDependencies = depPtr.get();
|
||||
}
|
||||
else
|
||||
sContext.psDependencies = dependencies;
|
||||
|
||||
for (i = 0; i < psShader->asPhases.size(); ++i)
|
||||
{
|
||||
|
@ -402,7 +402,7 @@ static void ReadResources(const uint32_t* pui32Tokens,//in
|
||||
|
||||
psShaderInfo->psResourceBindings.clear();
|
||||
psShaderInfo->psResourceBindings.resize(ui32NumResourceBindings);
|
||||
psResBindings = &psShaderInfo->psResourceBindings[0];
|
||||
psResBindings = ui32NumResourceBindings == 0 ? NULL : &psShaderInfo->psResourceBindings[0];
|
||||
|
||||
for(i=0; i < ui32NumResourceBindings; ++i)
|
||||
{
|
||||
@ -415,7 +415,7 @@ static void ReadResources(const uint32_t* pui32Tokens,//in
|
||||
|
||||
psShaderInfo->psConstantBuffers.clear();
|
||||
psShaderInfo->psConstantBuffers.resize(ui32NumConstantBuffers);
|
||||
psConstantBuffers = &psShaderInfo->psConstantBuffers[0];
|
||||
psConstantBuffers = ui32NumConstantBuffers == 0 ? NULL : &psShaderInfo->psConstantBuffers[0];
|
||||
|
||||
for(i=0; i < ui32NumConstantBuffers; ++i)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user