MCPcopy Create free account
hub / github.com/GPUOpen-Effects/GeometryFX / CheckShaderFile

Method CheckShaderFile

framework/d3d11/amd_sdk/src/ShaderCache.cpp:3079–3101  ·  view source on GitHub ↗

-------------------------------------------------------------------------------------- Checks to see if the object file exists for a given shader --------------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

3077// Checks to see if the object file exists for a given shader
3078//--------------------------------------------------------------------------------------
3079BOOL ShaderCache::CheckShaderFile( Shader* pShader )
3080{
3081 wchar_t wsShaderPathName[m_uPATHNAME_MAX_LENGTH];
3082
3083 CreateFullPathFromInputFilename( wsShaderPathName, pShader->m_wsSourceFile );
3084
3085 if (_waccess( wsShaderPathName, 00 ) != -1)
3086 {
3087 return TRUE;
3088 }
3089 else
3090 {
3091 wchar_t wsErrorText[m_uCOMMAND_LINE_MAX_LENGTH];
3092 swprintf_s( wsErrorText, L"Error: %s (FILE NOT FOUND)\n", wsShaderPathName );
3093
3094 const bool kbAppendToError = (wcslen( m_wsLastShaderError ) < (3 * m_uCOMMAND_LINE_MAX_LENGTH));
3095 swprintf_s( m_wsLastShaderError, L"%s%s", (m_bHasShaderErrorsToDisplay && kbAppendToError) ? m_wsLastShaderError : L"", wsErrorText );
3096 m_bHasShaderErrorsToDisplay = true;
3097 m_shaderErrorRenderedCount = 0;
3098 }
3099
3100 return FALSE;
3101}
3102
3103//--------------------------------------------------------------------------------------
3104// Checks to see if the oject file exists for a given shader

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected