1 registered members (AbrahamR),
717
guests, and 4
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Unfreed memory: TFX
#464539
02/24/17 12:55
02/24/17 12:55
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
OP
Senior Expert
|
OP
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
Hello! I have a bunch of unfreed memory warnings in my acklog.txt after a regular exit, with the tag "TFX". Unfreed: 1507, TFX, 8 bytes Unfreed: 1510, TFX, 8 bytes Unfreed: 1601, TFX, 8 bytes Unfreed: 1604, TFX, 8 bytes Unfreed: 1762, TFX, 8 bytes Unfreed: 1767, TFX, 8 bytes Unfreed: 1779, TFX, 8 bytes Unfreed: 1782, TFX, 8 bytes Unfreed: 1787, TFX, 8 bytes Unfreed: 1790, TFX, 8 bytes Unfreed: 1795, TFX, 8 bytes Unfreed: 1798, TFX, 8 bytes Unfreed: 1806, TFX, 8 bytes Unfreed: 1809, TFX, 8 bytes Unfreed: 1813, TFX, 8 bytes Unfreed: 1816, TFX, 8 bytes Unfreed: 1824, TFX, 8 bytes Unfreed: 1827, TFX, 8 bytes Unfreed: 1900, TFX, 8 bytes Unfreed: 1903, TFX, 8 bytes Unfreed: 2133, TFX, 8 bytes Unfreed: 2136, TFX, 8 bytes Unfreed: 2285, TFX, 8 bytes Unfreed: 2288, TFX, 8 bytes Unfreed: 2294, TFX, 8 bytes Unfreed: 2297, TFX, 8 bytes Unfreed: 2336, TFX, 8 bytes Unfreed: 2339, TFX, 8 bytes Unfreed: 2406, TFX, 8 bytes Unfreed: 2409, TFX, 8 bytes Unfreed: 2414, TFX, 8 bytes Unfreed: 2417, TFX, 8 bytes Unfreed: 2425, TFX, 8 bytes Unfreed: 2428, TFX, 8 bytes Unfreed: 2474, TFX, 8 bytes Unfreed: 2477, TFX, 8 bytes Unfreed: 2523, TFX, 8 bytes Unfreed: 2526, TFX, 8 bytes Unfreed: 2529, TFX, 8 bytes Unfreed: 2532, TFX, 8 bytes Unfreed: 2538, TFX, 8 bytes Unfreed: 2541, TFX, 8 bytes Unfreed: 2545, TFX, 12 bytes Unfreed: 2548, TFX, 12 bytes Unfreed: 2552, TFX, 8 bytes Unfreed: 2555, TFX, 8 bytes As I cannot find this tag anywhere in my files (and it does not follow my tag scheme) I assume it's something in the engine. Maybe some unicode (truetype font) issue? It would be great if you could tell me its meaning as well as optionally give a hint where to look for memory issues. Thanks!
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
Re: Unfreed memory: TFX
[Re: jcl]
#464547
02/24/17 18:45
02/24/17 18:45
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
OP
Senior Expert
|
OP
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
I see! For a bunch of materials I use the same file but with two techniques (camera + refraction/ special view), like this:
MATERIAL* mat_water_camera =
{
technique = "camera";
effect = "water_crcombo.fx";
flags = AUTORELOAD;
}
MATERIAL* mat_water_refrac =
{
technique = "refrac";
effect = "water_crcombo.fx";
flags = AUTORELOAD;
}
var mat_water_event()
{
if(render_view == camera) mtl = mat_water_camera;
else mtl = mat_water_refrac;
return 0;
}
MATERIAL* mat_water =
{
event = mat_water_event;
flags = AUTORELOAD | ENABLE_RENDER;
}
When I comment out all "technique =" lines in the material definitions there are no TFX memory leaks. Could this be an issue in the engine? => seems like it:
///////////////////////////////
#include <acknex.h>
#include <default.c>
///////////////////////////////
MATERIAL* my_technique_mat1 =
{
technique = "first";
effect = "technique.fx";
flags = AUTORELOAD;
}
MATERIAL* my_technique_mat2 =
{
technique = "second";
effect = "technique.fx";
flags = AUTORELOAD;
}
void main()
{
fps_max = 60;
level_load(NULL);
you = ent_create(SPHERE_MDL,vector(128,0,32),NULL);
your.material = my_technique_mat1;
me = ent_create(CUBE_MDL,vector(128,0,-32),NULL);
my.material = my_technique_mat2;
while(1)
{
my.pan += 5*time_step;
my.tilt += 5*time_step;
wait(1);
}
}
// technique.fx
const float4x4 matWorldViewProj;
const float4x4 matWorld;
const float fAmbient;
const float4 vecSunDir;
texture entSkin1;
sampler ColorMapSampler = sampler_state
{
Texture = <entSkin1>;
AddressU = Clamp;
AddressV = Clamp;
};
void DiffuseVS(
in float4 InPos: POSITION,
in float3 InNormal: NORMAL,
in float2 InTex: TEXCOORD0,
out float4 OutPos: POSITION,
out float2 OutTex: TEXCOORD0,
out float3 OutNormal: TEXCOORD1)
{
OutPos = mul(InPos, matWorldViewProj);
OutNormal = normalize(mul(InNormal, matWorld));
OutTex = InTex;
}
float4 DiffusePS(
in float2 InTex: TEXCOORD0,
in float3 InNormal: TEXCOORD1): COLOR
{
InNormal = normalize(InNormal);
float4 Diffuse = saturate(dot(-vecSunDir, InNormal)*2);
float4 Color = tex2D(ColorMapSampler, InTex);
float4 final = Color*Diffuse;
return (1+fAmbient) * final;
}
float4 SecondPS(
in float2 InTex: TEXCOORD0,
in float3 InNormal: TEXCOORD1): COLOR
{
InNormal = normalize(InNormal);
float4 Diffuse = saturate(dot(-vecSunDir, InNormal)*2);
float4 Color = tex2D(ColorMapSampler, InTex);
float4 final = Color*Diffuse;
return (1+fAmbient) * final*float4(1,0,0,1);
}
technique first
{
pass P0
{
VertexShader = compile vs_3_0 DiffuseVS();
PixelShader = compile ps_3_0 DiffusePS();
}
}
technique second
{
pass P0
{
VertexShader = compile vs_3_0 DiffuseVS();
PixelShader = compile ps_3_0 SecondPS();
}
}
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
|