Skip to content

Commit

Permalink
Updated headers to support Avisynth+ 3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
mysteryx93 committed Jun 17, 2020
1 parent bf1befb commit 2481cd0
Show file tree
Hide file tree
Showing 15 changed files with 1,914 additions and 1,095 deletions.
3 changes: 3 additions & 0 deletions ChangeLog.txt
@@ -1,3 +1,6 @@
Version 1.6.6: June 17th 2020
- Updated headers to support Avisynth+ 3.6

Version 1.6.5: May 13th 2018
- Fixed crash on NVidia cards when PlanarOut=true

Expand Down
2 changes: 1 addition & 1 deletion README.md
@@ -1,4 +1,4 @@
# AviSynth Shader v1.6.5
# AviSynth Shader v1.6.6

<a href="https://github.com/mysteryx93/AviSynthShader/releases">Download here >></a>

Expand Down
11 changes: 6 additions & 5 deletions Src/AviSynthShader.vcxproj
Expand Up @@ -23,29 +23,29 @@
<RootNamespace>eedi3</RootNamespace>
<Keyword>Win32Proj</Keyword>
<ProjectName>Shader</ProjectName>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
Expand Down Expand Up @@ -205,6 +205,7 @@
<ClInclude Include="MemoryPool.h" />
<ClInclude Include="PixelFormatParser.h" />
<ClInclude Include="PooledTexture.h" />
<ClInclude Include="posix.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="Shader.h" />
<ClInclude Include="D3D9RenderImpl.h" />
Expand Down
3 changes: 3 additions & 0 deletions Src/AviSynthShader.vcxproj.filters
Expand Up @@ -56,6 +56,9 @@
<ClInclude Include="D3D9Include.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="PixelFormatParser.h" />
<ClInclude Include="posix.h">
<Filter>avs</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Filter Include="avs">
Expand Down
4 changes: 2 additions & 2 deletions Src/ConvertShader.cpp
Expand Up @@ -153,7 +153,7 @@ PVideoFrame __stdcall ConvertShader::GetFrame(int n, IScriptEnvironment* env) {

void* b = useLut ? reinterpret_cast<void*>(lut.data()) : buff;
if (isPlusMt) { // if avs+MT, allocate buffer at every GetFrame() via buffer pool.
b = static_cast<IScriptEnvironment2*>(env)->Allocate(floatBufferPitch, 32, AVS_POOLED_ALLOC);
env->Allocate(floatBufferPitch, 32, AVS_POOLED_ALLOC);
if (!b) {
env->ThrowError("%s Failed to allocate temporal buffer.", name.c_str());
}
Expand All @@ -162,7 +162,7 @@ PVideoFrame __stdcall ConvertShader::GetFrame(int n, IScriptEnvironment* env) {
mainProc(dstp, srcp, dst->GetPitch(), src->GetPitch(), procWidth, procHeight, b);

if (isPlusMt) {
static_cast<IScriptEnvironment2*>(env)->Free(b);
env->Free(b);
}

return dst;
Expand Down
3 changes: 1 addition & 2 deletions Src/ExecuteShader.cpp
Expand Up @@ -32,8 +32,7 @@ ExecuteShader::ExecuteShader(PClip _child, PClip _clip1, PClip _clip2, PClip _cl

// Runs as MT_NICE_FILTER in AviSynth+ MT, otherwise MT_MULTI_INSTANCE
if (env->FunctionExists("SetFilterMTMode") && SUPPORT_MT_NICE_FILTER == true) {
auto env2 = static_cast<IScriptEnvironment2*>(env);
int ThreadCount = env2->GetProperty(AEP_THREADPOOL_THREADS);
int ThreadCount = env->GetEnvProperty(AEP_THREADPOOL_THREADS);
if (m_enginesCount > ThreadCount)
m_enginesCount = ThreadCount;
}
Expand Down

0 comments on commit 2481cd0

Please sign in to comment.