@@ -21,40 +21,40 @@ inline IShader::E_SHADER_STAGE getShaderStageFromSPIRVCrossExecutionModel(spv::E
21
21
IShader::E_SHADER_STAGE shaderStage;
22
22
switch (model)
23
23
{
24
- case spv::ExecutionModelVertex:
25
- shaderStage = IShader::E_SHADER_STAGE::ESS_VERTEX; break ;
26
- case spv::ExecutionModelTessellationControl:
27
- shaderStage = IShader::E_SHADER_STAGE::ESS_TESSELLATION_CONTROL; break ;
28
- case spv::ExecutionModelTessellationEvaluation:
29
- shaderStage = IShader::E_SHADER_STAGE::ESS_TESSELLATION_EVALUATION; break ;
30
- case spv::ExecutionModelGeometry:
31
- shaderStage = IShader::E_SHADER_STAGE::ESS_GEOMETRY; break ;
32
- case spv::ExecutionModelFragment:
33
- shaderStage = IShader::E_SHADER_STAGE::ESS_FRAGMENT; break ;
34
- case spv::ExecutionModelGLCompute:
35
- shaderStage = IShader::E_SHADER_STAGE::ESS_COMPUTE; break ;
36
- case spv::ExecutionModelTaskNV:
37
- shaderStage = IShader::E_SHADER_STAGE::ESS_TASK; break ;
38
- case spv::ExecutionModelMeshNV:
39
- shaderStage = IShader::E_SHADER_STAGE::ESS_MESH; break ;
40
- case spv::ExecutionModelRayGenerationKHR:
41
- shaderStage = IShader::E_SHADER_STAGE::ESS_RAYGEN; break ;
42
- case spv::ExecutionModelIntersectionKHR:
43
- shaderStage = IShader::E_SHADER_STAGE::ESS_INTERSECTION; break ;
44
- case spv::ExecutionModelAnyHitKHR:
45
- shaderStage = IShader::E_SHADER_STAGE::ESS_ANY_HIT; break ;
46
- case spv::ExecutionModelClosestHitKHR:
47
- shaderStage = IShader::E_SHADER_STAGE::ESS_MISS; break ;
48
- case spv::ExecutionModelMissKHR:
49
- shaderStage = IShader::E_SHADER_STAGE::ESS_MISS; break ;
50
- case spv::ExecutionModelCallableKHR:
51
- shaderStage = IShader::E_SHADER_STAGE::ESS_CALLABLE; break ;
52
- case spv::ExecutionModelKernel:
53
- case spv::ExecutionModelMax:
54
- default :
55
- assert (!" Shader stage not supported!" );
56
- shaderStage = IShader::E_SHADER_STAGE::ESS_UNKNOWN;
57
- break ;
24
+ case spv::ExecutionModelVertex:
25
+ shaderStage = IShader::E_SHADER_STAGE::ESS_VERTEX; break ;
26
+ case spv::ExecutionModelTessellationControl:
27
+ shaderStage = IShader::E_SHADER_STAGE::ESS_TESSELLATION_CONTROL; break ;
28
+ case spv::ExecutionModelTessellationEvaluation:
29
+ shaderStage = IShader::E_SHADER_STAGE::ESS_TESSELLATION_EVALUATION; break ;
30
+ case spv::ExecutionModelGeometry:
31
+ shaderStage = IShader::E_SHADER_STAGE::ESS_GEOMETRY; break ;
32
+ case spv::ExecutionModelFragment:
33
+ shaderStage = IShader::E_SHADER_STAGE::ESS_FRAGMENT; break ;
34
+ case spv::ExecutionModelGLCompute:
35
+ shaderStage = IShader::E_SHADER_STAGE::ESS_COMPUTE; break ;
36
+ case spv::ExecutionModelTaskNV:
37
+ shaderStage = IShader::E_SHADER_STAGE::ESS_TASK; break ;
38
+ case spv::ExecutionModelMeshNV:
39
+ shaderStage = IShader::E_SHADER_STAGE::ESS_MESH; break ;
40
+ case spv::ExecutionModelRayGenerationKHR:
41
+ shaderStage = IShader::E_SHADER_STAGE::ESS_RAYGEN; break ;
42
+ case spv::ExecutionModelIntersectionKHR:
43
+ shaderStage = IShader::E_SHADER_STAGE::ESS_INTERSECTION; break ;
44
+ case spv::ExecutionModelAnyHitKHR:
45
+ shaderStage = IShader::E_SHADER_STAGE::ESS_ANY_HIT; break ;
46
+ case spv::ExecutionModelClosestHitKHR:
47
+ shaderStage = IShader::E_SHADER_STAGE::ESS_MISS; break ;
48
+ case spv::ExecutionModelMissKHR:
49
+ shaderStage = IShader::E_SHADER_STAGE::ESS_MISS; break ;
50
+ case spv::ExecutionModelCallableKHR:
51
+ shaderStage = IShader::E_SHADER_STAGE::ESS_CALLABLE; break ;
52
+ case spv::ExecutionModelKernel:
53
+ case spv::ExecutionModelMax:
54
+ default :
55
+ assert (!" Shader stage not supported!" );
56
+ shaderStage = IShader::E_SHADER_STAGE::ESS_UNKNOWN;
57
+ break ;
58
58
}
59
59
return shaderStage;
60
60
}
@@ -80,5 +80,6 @@ SAssetBundle CSPVLoader::loadAsset(system::IFile* _file, const IAssetLoader::SAs
80
80
const SPIRV_CROSS_NAMESPACE::ParsedIR& parsedIR = parser.get_parsed_ir ();
81
81
SPIRV_CROSS_NAMESPACE::SPIREntryPoint defaultEntryPoint = parsedIR.entry_points .at (parsedIR.default_entry_point );
82
82
83
+ buffer->setContentHash (buffer->computeContentHash ());
83
84
return SAssetBundle (nullptr ,{core::make_smart_refctd_ptr<ICPUShader>(std::move (buffer), getShaderStageFromSPIRVCrossExecutionModel (defaultEntryPoint.model ), asset::IShader::E_CONTENT_TYPE::ECT_SPIRV, _file->getFileName ().string ())});
84
85
}
0 commit comments