Jammer-Thread

Hier kann über allgemeine Themen diskutiert werden, die sonst in kein Forum passen.
Insbesondere über Szene, Games, Kultur, Weltgeschehen, Persönliches, Recht, Hard- und Software.
IlikeMyLife
Establishment
Beiträge: 212
Registriert: 08.05.2011, 09:59
Benutzertext: Feel Free

Re: Jammer-Thread

Beitrag von IlikeMyLife »

Wieso denken viele Designer und Entwickler eigentlich nicht an uns arme Linkshänder... :-(

Wenn ich mir über die letzten Jahre so manchen Shooter oder RPG ansehe, hat der Hauptcharakter meist wie
zu erwarten, die rechte Hand als Haupthand für Waffen und Gegenstände...

Habt ihr mal versucht, eine Waffe als Linkshänder in die rechte Hand zu nehmen und auf nur 10 Meter ein Ziel zu treffen?!
Ich war lange Zeit bei der Bundeswehr und habe dieses damals getestet...
Ein Krampf sage ich euch...

Anderes Beispiel... Baseball... Ball in die rechte Hand als Linkshänder nehmen und versuchen, so weit es geht zu werfen...
Geht nicht gut..!

Wie soll sich denn jemand wie ich fühlen, wenn ich einen Shooter auf meinem Rechner spiele, die Waffe in der rechten Hand,
und soll auf größere Entfernung ein Ziel treffen...

Games müssen zwar keinesfalls realistisch sein... aber ich möchte mich als Spieler doch gerne in meinen Charakter hinein versetzen können... nur dieser Punkt macht es für mich schier unmöglich :-(

So... dass musste mal raus :D
Benutzeravatar
eXile
Establishment
Beiträge: 1136
Registriert: 28.02.2009, 13:27

Re: Jammer-Thread

Beitrag von eXile »

CodingCat hat geschrieben:SO unzugänglich geworden, die Startseite als simpler redundanter Kanal für alle auch nur irgendwie verwandten Newsseiten SO unübersichtlich (News über 7, in Worten SIEBEN Tage hinweg nach Bewertung statt Datum zu sortieren, NEWS, WTF, OLDS!) und zugleich von jeglichem eigenen Inhalt befreit worden, dass kaum noch ein Grund bleibt, die Seite überhaupt zu besuchen.
Ich werde mir irgendwann alle interessanten Artikel rausziehen und dann den Bookmark löschen.
waigie
Beiträge: 82
Registriert: 20.05.2009, 19:37

Re: Jammer-Thread

Beitrag von waigie »

Solltest du das tun, ich hätte gern ne Kopie, seit dem Redesign find ich mich in der Artikelsektion nicht mehr zurecht
Benutzeravatar
Krishty
Establishment
Beiträge: 8268
Registriert: 26.02.2009, 11:18
Benutzertext: state is the enemy
Kontaktdaten:

Re: Jammer-Thread

Beitrag von Krishty »

http://msdn.microsoft.com/en-us/library/microsoft.directx_sdk.conversion.xmconvertvectorfloattouint hat geschrieben:Converts an XMVECTOR with FLOAT components to an XMVECTOR with UINT components and applies a uniform bias.

    XMVECTOR XMConvertVectorFloatToUInt(
        XMVECTOR VFloat,
        UINT MulExponent
    )


Returns the converted vector, where each component has been multiplied by two raised to the MulExponent power.
Tolles Bias; ich will aber mit 255 multiplizieren und nicht 256. Was macht die Funktion jetzt? Runden? Abschneiden? Gegen 0 oder gegen +/- unendlich? Was passiert, wenn die Zahlen zu groß oder zu klein für UINT sind?

Warum steht sowas nicht in der Doku?
Bild
seziert Ace Combat, Driver, und S.T.A.L.K.E.R.   —   rendert Sterne
Benutzeravatar
Thoran
Establishment
Beiträge: 224
Registriert: 15.05.2009, 12:51
Wohnort: Stuttgart
Kontaktdaten:

Re: Jammer-Thread

Beitrag von Thoran »

Warum ist es immer dasselbe: Man integriert eine neue Funktion wie SkyX in seine Engine und man hat "nen schwarzen Bildschirm" (in dem Fall ne schwarze Skybox). Im Beispielprogramm von SkyX läuft es dafür ohne Probleme mit dem selben Code. Dann mach ich mich mal auf die Suche nach der Nadel im Heuhaufen.:(

Thoran
Wer Rechtschreibfehler findet, darf diese gerne behalten.
Mein Entwicklertagebuch
Aktuelle Projekte: Universum: Domination (ehemalig AlphaOmega),Universum: Sternenjäger, PixelWars: Highscore-based Top-Down-Spaceshooter
Spieleengine Unreal 5
Benutzeravatar
Krishty
Establishment
Beiträge: 8268
Registriert: 26.02.2009, 11:18
Benutzertext: state is the enemy
Kontaktdaten:

Re: Jammer-Thread

Beitrag von Krishty »

Stürzt ab:

Code: Alles auswählen

auto const scaleFactors(::XMVectorSet(sphere.radius, -sphere.radius, sphere.radius, 1.0f));
flushTriangleBatch();
Funktioniert:

Code: Alles auswählen

flushTriangleBatch();
auto const scaleFactors(::XMVectorSet(sphere.radius, -sphere.radius, sphere.radius, 1.0f));
Abstürzender Maschinentext (Zeile 30):

Code: Alles auswählen

		void draw(
			Sphere const &	sphere,
			BGRC const &	color
		) {
01309280  push        ebp  
01309281  mov         ebp,esp  
01309283  and         esp,0FFFFFFF8h  
01309286  sub         esp,19Ch  
			auto const scaleFactors(::XMVectorSet(sphere.radius, -sphere.radius, sphere.radius, 1.0f));
0130928C  movss       xmm3,dword ptr [__real@3f800000 (133D578h)]  
01309294  push        ebx  
01309295  push        esi  
01309296  mov         esi,eax  
01309298  mov         eax,dword ptr [sphere]  
0130929B  movss       xmm0,dword ptr [eax+10h]  

			//flushTriangleBatch();
			assert(toMyNextBatchedTriangleVertex <= toEndOf(myTriangleVertexBatch));
			if(toMyNextBatchedTriangleVertex > toBeginningOf(myTriangleVertexBatch)) {
013092A0  mov         eax,dword ptr [esi+3F28h]  
013092A6  movaps      xmm1,xmm0  
013092A9  xorps       xmm1,xmmword ptr [__mask@@NegFloat@ (133D640h)]  
013092B0  movaps      xmm2,xmm0  
013092B3  push        edi  
013092B4  lea         edi,[esi+2428h]  
013092BA  unpcklps    xmm1,xmm3  
013092BD  unpcklps    xmm2,xmm0  
013092C0  unpcklps    xmm2,xmm1  
>>>>>>>> 013092C3  movaps      xmmword ptr [esp+10h],xmm2  <<<<<<<<<< 0xC0000005: Access violation reading location 0x00000000.
013092C8  cmp         eax,edi  
013092CA  jbe         ThreeView::D3D9Rasterizer::draw+92h (1309312h)  
				myGPU->DrawPrimitiveUP(D3DPT_TRIANGLELIST, (toMyNextBatchedTriangleVertex - toBeginningOf(myTriangleVertexBatch)) / 3, myTriangleVertexBatch, sizeof(*myTriangleVertexBatch));
013092CC  sub         eax,esi  
013092CE  lea         ecx,[eax-2428h]  
013092D4  mov         eax,2AAAAAABh  
013092D9  imul        ecx  
013092DB  mov         ebx,dword ptr [esi+8]  
013092DE  sar         edx,2  
013092E1  mov         ecx,edx  
013092E3  shr         ecx,1Fh  
013092E6  add         ecx,edx  
013092E8  mov         eax,55555556h  
013092ED  imul        ecx  
013092EF  mov         eax,dword ptr [ebx]  
013092F1  push        18h  
013092F3  mov         ecx,edx  
013092F5  push        edi  
013092F6  shr         ecx,1Fh  
013092F9  add         ecx,edx  
013092FB  mov         edx,dword ptr [eax+14Ch]  
01309301  push        ecx  
01309302  push        4  
01309304  push        ebx  
01309305  call        edx  
				toMyNextBatchedTriangleVertex = toBeginningOf(myTriangleVertexBatch);
01309307  movaps      xmm2,xmmword ptr [esp+10h]  
0130930C  mov         dword ptr [esi+3F28h],edi  
			}

			static __declspec(align(16)) struct {
				float x, y, z, w;
			} const discPositions[] = {
				{ -0.38268343236509039f,  0.92387953251128652f, 0.0f, 1.0f },
				{ -0.70710678118654768f,  0.70710678118654735f, 0.0f, 1.0f },
				{ -0.92387953251128663f,  0.38268343236509000f, 0.0f, 1.0f },
				{ -1.00000000000000000f,  0.00000000000000000f, 0.0f, 1.0f },
				{ -0.92387953251128652f, -0.38268343236509034f, 0.0f, 1.0f },
				{ -0.70710678118654746f, -0.70710678118654768f, 0.0f, 1.0f },
				{ -0.38268343236508967f, -0.92387953251128685f, 0.0f, 1.0f },
				{  0.00000000000000000f, -1.00000000000000000f, 0.0f, 1.0f },
				{  0.38268343236508989f, -0.92387953251128674f, 0.0f, 1.0f },
				{  0.70710678118654757f, -0.70710678118654746f, 0.0f, 1.0f },
				{  0.92387953251128674f, -0.38268343236508973f, 0.0f, 1.0f },
				{  1.00000000000000000f,  0.00000000000000000f, 0.0f, 1.0f },
				{  0.92387953251128674f,  0.38268343236508984f, 0.0f, 1.0f },
				{  0.70710678118654746f,  0.70710678118654757f, 0.0f, 1.0f },
				{  0.38268343236508978f,  0.92387953251128674f, 0.0f, 1.0f },
				{  0.00000000000000000f,  1.00000000000000000f, 0.0f, 1.0f }
			};

			static Size const numberOfVertices(sizeof(discPositions) / sizeof(discPositions[0]));
			Vertex vertices[numberOfVertices];
			for(auto index(0u); index < numberOfVertices; ++index) {
				vertices[index] = Vertex::from(
					::XMVectorMultiplyAdd(
						::XMLoadFloat4A((XMFLOAT4A const *)&discPositions[index]),
						scaleFactors,
						sphere.xyz
					),
					color
				);
01309312  mov         eax,dword ptr [sphere]  
01309315  mov         ecx,dword ptr [color]  
01309318  movaps      xmm4,xmmword ptr [eax]  
0130931B  mov         edx,dword ptr [ecx]  
0130931D  xorps       xmm3,xmm3  
01309320  lea         eax,[esp+28h]  
01309324  xor         ecx,ecx  
01309326  jmp         ThreeView::D3D9Rasterizer::draw+0B0h (1309330h)  
01309328  lea         esp,[esp]  
0130932F  nop  
01309330  movaps      xmm0,xmmword ptr discPositions (133BE90h)[ecx]  
01309337  mulps       xmm0,xmm2  
0130933A  addps       xmm0,xmm4  
0130933D  movss       dword ptr [esp+0Ch],xmm0  
01309343  fld         dword ptr [esp+0Ch]  
01309347  movaps      xmm1,xmm0  
0130934A  shufps      xmm1,xmm0,55h  
0130934E  fstp        dword ptr [esp+10h]  
01309352  movss       dword ptr [esp+0Ch],xmm1  
01309358  fld         dword ptr [esp+0Ch]  
0130935C  shufps      xmm0,xmm0,0AAh  
01309360  movss       dword ptr [esp+0Ch],xmm0  
01309366  fstp        dword ptr [esp+14h]  
0130936A  fld         dword ptr [esp+0Ch]  
0130936E  movq        xmm0,mmword ptr [esp+10h]  
01309374  movq        mmword ptr [eax],xmm0  
01309378  fstp        dword ptr [esp+18h]  
0130937C  mov         dword ptr [esp+1Ch],edx  
01309380  movq        xmm0,mmword ptr [esp+18h]  
01309386  movq        mmword ptr [eax+8],xmm0  
0130938B  movss       dword ptr [esp+20h],xmm3  
01309391  movss       dword ptr [esp+24h],xmm3  
01309397  movq        xmm0,mmword ptr [esp+20h]  
0130939D  movq        mmword ptr [eax+10h],xmm0  
013093A2  add         ecx,10h  
013093A5  add         eax,18h  
013093A8  cmp         ecx,100h  
013093AE  jb          ThreeView::D3D9Rasterizer::draw+0B0h (1309330h)  
			}

			set(MaterialState::flatOrGouraudShaded);
013093B0  cmp         dword ptr [esi+23F4h],0  
013093B7  je          $LN91+25h (1309450h)  
013093BD  mov         eax,dword ptr [esi+3F28h]  
013093C3  cmp         eax,edi  
013093C5  jbe         ThreeView::D3D9Rasterizer::draw+188h (1309408h)  
013093C7  sub         eax,esi  
013093C9  lea         ecx,[eax-2428h]  
013093CF  mov         eax,2AAAAAABh  
013093D4  imul        ecx  
013093D6  mov         ebx,dword ptr [esi+8]  
013093D9  sar         edx,2  
013093DC  mov         ecx,edx  
013093DE  shr         ecx,1Fh  
013093E1  add         ecx,edx  
013093E3  mov         eax,55555556h  
013093E8  imul        ecx  
013093EA  push        18h  
013093EC  mov         eax,edx  
013093EE  shr         eax,1Fh  
013093F1  push        edi  
013093F2  add         eax,edx  
013093F4  push        eax  
013093F5  mov         eax,dword ptr [ebx]  
013093F7  mov         ecx,dword ptr [eax+14Ch]  
013093FD  push        4  
013093FF  push        ebx  
01309400  call        ecx  
01309402  mov         dword ptr [esi+3F28h],edi  
01309408  mov         eax,dword ptr [esi+8]  
0130940B  mov         ecx,dword ptr [esi+5A4h]  
01309411  mov         edx,dword ptr [eax]  
01309413  mov         edx,dword ptr [edx+1ACh]  
01309419  push        ecx  
0130941A  push        eax  
0130941B  call        edx  
0130941D  test        eax,eax  
0130941F  jns         $LN91 (130942Bh)  
01309421  mov         edi,offset string "IDirect3DDevice9::SetPixelShader"... (132369Ch)  
01309426  call        D3D9::throwErrorOfCall (13010E0h)  
$LN91:
0130942B  cmp         dword ptr [esi+23F4h],2  
01309432  jne         $LN91+1Bh (1309446h)  
01309434  mov         eax,dword ptr [esi+8]  
01309437  mov         ecx,dword ptr [eax]  
01309439  mov         edx,dword ptr [ecx+0E4h]  
0130943F  push        3  
01309441  push        8  
01309443  push        eax  
01309444  call        edx  
01309446  mov         dword ptr [esi+23F4h],0  
			myGPU->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, numberOfVertices - 2, vertices, sizeof(*vertices));
01309450  mov         esi,dword ptr [esi+8]  
01309453  mov         eax,dword ptr [esi]  
01309455  mov         edx,dword ptr [eax+14Ch]  
0130945B  push        18h  
0130945D  lea         ecx,[esp+2Ch]  
01309461  push        ecx  
01309462  push        0Eh  
01309464  push        6  
01309466  push        esi  
01309467  call        edx  

			return;
		}
01309469  pop         edi  
0130946A  pop         esi  
0130946B  pop         ebx  
0130946C  mov         esp,ebp  
0130946E  pop         ebp  
0130946F  ret         8  
Funktionierender Maschinentext:

Code: Alles auswählen

		void draw(
			Sphere const &	sphere,
			BGRC const &	color
		) {
00DE9280  push        ebp  
00DE9281  mov         ebp,esp  
00DE9283  and         esp,0FFFFFFF8h  
00DE9286  sub         esp,19Ch  
00DE928C  push        ebx  
00DE928D  push        esi  
00DE928E  mov         esi,eax  
			//flushTriangleBatch();
			assert(toMyNextBatchedTriangleVertex <= toEndOf(myTriangleVertexBatch));
			if(toMyNextBatchedTriangleVertex > toBeginningOf(myTriangleVertexBatch)) {
00DE9290  mov         eax,dword ptr [esi+3F28h]  
00DE9296  push        edi  
00DE9297  lea         edi,[esi+2428h]  
00DE929D  cmp         eax,edi  
00DE929F  jbe         ThreeView::D3D9Rasterizer::draw+62h (0DE92E2h)  
				myGPU->DrawPrimitiveUP(D3DPT_TRIANGLELIST, (toMyNextBatchedTriangleVertex - toBeginningOf(myTriangleVertexBatch)) / 3, myTriangleVertexBatch, sizeof(*myTriangleVertexBatch));
00DE92A1  sub         eax,esi  
00DE92A3  lea         ecx,[eax-2428h]  
00DE92A9  mov         eax,2AAAAAABh  
00DE92AE  imul        ecx  
00DE92B0  mov         ebx,dword ptr [esi+8]  
00DE92B3  sar         edx,2  
00DE92B6  mov         ecx,edx  
00DE92B8  shr         ecx,1Fh  
00DE92BB  add         ecx,edx  
00DE92BD  mov         eax,55555556h  
00DE92C2  imul        ecx  
00DE92C4  push        18h  
00DE92C6  mov         eax,edx  
00DE92C8  shr         eax,1Fh  
00DE92CB  push        edi  
00DE92CC  add         eax,edx  
00DE92CE  push        eax  
00DE92CF  mov         eax,dword ptr [ebx]  
00DE92D1  mov         ecx,dword ptr [eax+14Ch]  
00DE92D7  push        4  
00DE92D9  push        ebx  
00DE92DA  call        ecx  
				toMyNextBatchedTriangleVertex = toBeginningOf(myTriangleVertexBatch);
00DE92DC  mov         dword ptr [esi+3F28h],edi  
			}

			auto const scaleFactors(::XMVectorSet(sphere.radius, -sphere.radius, sphere.radius, 1.0f));
00DE92E2  mov         eax,dword ptr [sphere]  
00DE92E5  movss       xmm0,dword ptr [eax+10h]  
00DE92EA  movss       xmm3,dword ptr [__real@3f800000 (0E1D578h)]  

			static __declspec(align(16)) struct {
				float x, y, z, w;
			} const discPositions[] = {
				{ -0.38268343236509039f,  0.92387953251128652f, 0.0f, 1.0f },
				{ -0.70710678118654768f,  0.70710678118654735f, 0.0f, 1.0f },
				{ -0.92387953251128663f,  0.38268343236509000f, 0.0f, 1.0f },
				{ -1.00000000000000000f,  0.00000000000000000f, 0.0f, 1.0f },
				{ -0.92387953251128652f, -0.38268343236509034f, 0.0f, 1.0f },
				{ -0.70710678118654746f, -0.70710678118654768f, 0.0f, 1.0f },
				{ -0.38268343236508967f, -0.92387953251128685f, 0.0f, 1.0f },
				{  0.00000000000000000f, -1.00000000000000000f, 0.0f, 1.0f },
				{  0.38268343236508989f, -0.92387953251128674f, 0.0f, 1.0f },
				{  0.70710678118654757f, -0.70710678118654746f, 0.0f, 1.0f },
				{  0.92387953251128674f, -0.38268343236508973f, 0.0f, 1.0f },
				{  1.00000000000000000f,  0.00000000000000000f, 0.0f, 1.0f },
				{  0.92387953251128674f,  0.38268343236508984f, 0.0f, 1.0f },
				{  0.70710678118654746f,  0.70710678118654757f, 0.0f, 1.0f },
				{  0.38268343236508978f,  0.92387953251128674f, 0.0f, 1.0f },
				{  0.00000000000000000f,  1.00000000000000000f, 0.0f, 1.0f }
			};

			static Size const numberOfVertices(sizeof(discPositions) / sizeof(discPositions[0]));
			Vertex vertices[numberOfVertices];
			for(auto index(0u); index < numberOfVertices; ++index) {
				vertices[index] = Vertex::from(
					::XMVectorMultiplyAdd(
						::XMLoadFloat4A((XMFLOAT4A const *)&discPositions[index]),
						scaleFactors,
						sphere.xyz
					),
					color
				);
00DE92F2  mov         edx,dword ptr [color]  
00DE92F5  movaps      xmm4,xmmword ptr [eax]  
00DE92F8  mov         edx,dword ptr [edx]  
00DE92FA  movaps      xmm1,xmm0  
00DE92FD  xorps       xmm1,xmmword ptr [__mask@@NegFloat@ (0E1D640h)]  
00DE9304  movaps      xmm2,xmm0  
00DE9307  lea         eax,[esp+28h]  
00DE930B  xor         ecx,ecx  
00DE930D  unpcklps    xmm1,xmm3  
00DE9310  xorps       xmm3,xmm3  
00DE9313  unpcklps    xmm2,xmm0  
00DE9316  unpcklps    xmm2,xmm1  
00DE9319  lea         esp,[esp]  
00DE9320  movaps      xmm0,xmmword ptr discPositions (0E1BE90h)[ecx]  
00DE9327  mulps       xmm0,xmm2  
00DE932A  addps       xmm0,xmm4  
00DE932D  movss       dword ptr [esp+0Ch],xmm0  
00DE9333  fld         dword ptr [esp+0Ch]  
00DE9337  movaps      xmm1,xmm0  
00DE933A  shufps      xmm1,xmm0,55h  
00DE933E  fstp        dword ptr [esp+10h]  
00DE9342  movss       dword ptr [esp+0Ch],xmm1  
00DE9348  fld         dword ptr [esp+0Ch]  
00DE934C  shufps      xmm0,xmm0,0AAh  
00DE9350  movss       dword ptr [esp+0Ch],xmm0  
00DE9356  fstp        dword ptr [esp+14h]  
00DE935A  fld         dword ptr [esp+0Ch]  
00DE935E  movq        xmm0,mmword ptr [esp+10h]  
00DE9364  movq        mmword ptr [eax],xmm0  
00DE9368  fstp        dword ptr [esp+18h]  
00DE936C  mov         dword ptr [esp+1Ch],edx  
00DE9370  movq        xmm0,mmword ptr [esp+18h]  
00DE9376  movq        mmword ptr [eax+8],xmm0  
00DE937B  movss       dword ptr [esp+20h],xmm3  
00DE9381  movss       dword ptr [esp+24h],xmm3  
00DE9387  movq        xmm0,mmword ptr [esp+20h]  
00DE938D  movq        mmword ptr [eax+10h],xmm0  
00DE9392  add         ecx,10h  
00DE9395  add         eax,18h  
00DE9398  cmp         ecx,100h  
00DE939E  jb          ThreeView::D3D9Rasterizer::draw+0A0h (0DE9320h)  
			}

			set(MaterialState::flatOrGouraudShaded);
00DE93A0  cmp         dword ptr [esi+23F4h],0  
00DE93A7  je          $LN91+25h (0DE9440h)  
00DE93AD  mov         eax,dword ptr [esi+3F28h]  
00DE93B3  cmp         eax,edi  
00DE93B5  jbe         ThreeView::D3D9Rasterizer::draw+178h (0DE93F8h)  
00DE93B7  sub         eax,esi  
00DE93B9  lea         ecx,[eax-2428h]  
00DE93BF  mov         eax,2AAAAAABh  
00DE93C4  imul        ecx  
00DE93C6  mov         ebx,dword ptr [esi+8]  
00DE93C9  sar         edx,2  
00DE93CC  mov         ecx,edx  
00DE93CE  shr         ecx,1Fh  
00DE93D1  add         ecx,edx  
00DE93D3  mov         eax,55555556h  
00DE93D8  imul        ecx  
00DE93DA  push        18h  
00DE93DC  mov         eax,edx  
00DE93DE  shr         eax,1Fh  
00DE93E1  push        edi  
00DE93E2  add         eax,edx  
00DE93E4  push        eax  
00DE93E5  mov         eax,dword ptr [ebx]  
00DE93E7  mov         ecx,dword ptr [eax+14Ch]  
00DE93ED  push        4  
00DE93EF  push        ebx  
00DE93F0  call        ecx  
00DE93F2  mov         dword ptr [esi+3F28h],edi  
00DE93F8  mov         eax,dword ptr [esi+8]  
00DE93FB  mov         ecx,dword ptr [esi+5A4h]  
00DE9401  mov         edx,dword ptr [eax]  
00DE9403  mov         edx,dword ptr [edx+1ACh]  
00DE9409  push        ecx  
00DE940A  push        eax  
00DE940B  call        edx  
00DE940D  test        eax,eax  
00DE940F  jns         $LN91 (0DE941Bh)  
00DE9411  mov         edi,offset string "IDirect3DDevice9::SetPixelShader"... (0E0369Ch)  
00DE9416  call        D3D9::throwErrorOfCall (0DE10E0h)  
$LN91:
00DE941B  cmp         dword ptr [esi+23F4h],2  
00DE9422  jne         $LN91+1Bh (0DE9436h)  
00DE9424  mov         eax,dword ptr [esi+8]  
00DE9427  mov         ecx,dword ptr [eax]  
00DE9429  mov         edx,dword ptr [ecx+0E4h]  
00DE942F  push        3  
00DE9431  push        8  
00DE9433  push        eax  
00DE9434  call        edx  
00DE9436  mov         dword ptr [esi+23F4h],0  
			myGPU->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, numberOfVertices - 2, vertices, sizeof(*vertices));
00DE9440  mov         esi,dword ptr [esi+8]  
00DE9443  mov         eax,dword ptr [esi]  
00DE9445  mov         edx,dword ptr [eax+14Ch]  
00DE944B  push        18h  
00DE944D  lea         ecx,[esp+2Ch]  
00DE9451  push        ecx  
00DE9452  push        0Eh  
00DE9454  push        6  
00DE9456  push        esi  
00DE9457  call        edx  

			return;
		}
00DE9459  pop         edi  
00DE945A  pop         esi  
00DE945B  pop         ebx  
00DE945C  mov         esp,ebp  
00DE945E  pop         ebp  
00DE945F  ret         8  
Ich habe keinen Bock, da jetzt nach der Ursache zu suchen. Ich sehe nur: Zugriffsverletzung in der Nähe von SSE-lastigem Text; drumherum funktioniert alles und die Funktion, die ich da aufrufe, ist in hundert anderen Situationen auf Herz und Nieren getestet. Muss ein Compiler-Fehler sein.

Schaltet in VC niemals SSE ein. Drauf geschissen, dass es ohne Intrinsics und SIMD langsamer ist. Sobald SSE an ist, kommen die Geister. Ihr seid dann verflucht. Matrix mit 200.000 Testfällen, dass ich nicht lache. Der bekackte Code Generator macht mehr Fehler als ich, wenn ich das von Hand in Assembler schreibe. Und ist ähnlich lahm. Nehmt am besten von vornherein einen besseren Compiler (lies: jeden anderen außer Borland).
seziert Ace Combat, Driver, und S.T.A.L.K.E.R.   —   rendert Sterne
Benutzeravatar
CodingCat
Establishment
Beiträge: 1857
Registriert: 02.03.2009, 21:25
Wohnort: Student @ KIT
Kontaktdaten:

Re: Jammer-Thread

Beitrag von CodingCat »

Noch vor wenigen Wochen war man stolz, weil man meinte, dass man Templates nun durch und durch verstanden hatte. Nur wenige Wochen später stellte man sich die Frage, ob die damit einhergehende leicht erhöhte Komplexität und stellenweise Undurchdringlichkeit beim Debuggen denn wirklich durch das Sparen von etwa 10% der Recheninstruktionen gerechtfertigt wäre.

Code: Alles auswählen

namespace Impl
{

struct op_identity
{
	template <class Result, class Operand>
	static Result apply(const Operand &operand) { return operand; }
};
struct op_negate
{
	template <class Result, class Operand>
	static Result apply(const Operand &operand) { return -operand; }
};
struct op_add
{
	template <class Result, class Left, class Right>
	static Result apply(const Left &left, const Right &right) { return left + right; }
};
struct op_subtract
{
	template <class Result, class Left, class Right>
	static Result apply(const Left &left, const Right &right) { return left - right; }
};
struct op_multiply
{
	template <class Result, class Left, class Right>
	static Result apply(const Left &left, const Right &right) { return left * right; }
};
struct op_divide
{
	template <class Result, class Left, class Right>
	static Result apply(const Left &left, const Right &right) { return left / right; }
};
struct op_modulo
{
	template <class Result, class Left, class Right>
	static Result apply(const Left &left, const Right &right) { return left % right; }
};

struct acc_tuple
{
	template <class Result, class Operand, class Index>
	LEAN_INLINE static Result component(const Operand &operand, Index n) { return operand[n]; }
};

struct acc_scalar
{
	template <class Result, class Operand, class Index>
	LEAN_INLINE static Result component(const Operand &operand, Index) { return operand; }
};

/// Tuple expression mask class.
template <class Derived, class Element, size_t Count>
class tuple_expr_mask
{
protected:
	tuple_expr_mask() { }
	tuple_expr_mask(const tuple_expr_mask&) { }
	tuple_expr_mask& operator =(const tuple_expr_mask&) { return *this; }

public:
	/// Most derived type.
	typedef Derived expr_type;
	/// Value type.
	typedef Element value_type;
	/// Size type.
	typedef size_t size_type;
	/// Number of elements.
	static const size_type count = Count;

	/// Returns a pointer to the most-derived expression.
	LEAN_INLINE expr_type& expression() { return static_cast<expr_type&>(*this); }
	/// Returns a pointer to the most-derived expression.
	LEAN_INLINE const expr_type& expression() const { return static_cast<const expr_type&>(*this); }

	/// Accesses the n-th value.
	LEAN_INLINE value_type operator [](typename size_type n) const
	{
		return this->expression()[n];
	}

	/// Gets the number of elements in this tuple expression.
	LEAN_INLINE size_type size() const { return count; }

	/// Compares this tuple expression to the given tuple expression.
	template <class OtherExpr, class Element, size_t Count>
	bool operator ==(const tuple_expr_mask<OtherExpr, Element, Count> &right) const
	{
		for (size_t i = 0; i < Count; ++i)
			if ((*this)[i] != right[i])
				return false;
		return true;
	}
};

/// Tuple expression class.
template <class Derived, class Element, size_t Count, class SubExpression = Element>
class tuple_expr : public tuple_expr_mask<Derived, Element, Count>
{
protected:
	tuple_expr() { }
	tuple_expr(const tuple_expr&) { }
	tuple_expr& operator =(const tuple_expr&) { return *this; }

public:
	/// Mask type.
	typedef tuple_expr_mask<Derived, Element, Count> mask_type;
	/// Subexpression type.
	typedef SubExpression subexpr_type;

	/// Accesses the n-th subexpression.
	LEAN_INLINE subexpr_type operator [](typename mask_type::size_type n) const
	{
		return this->expression()[n];
	}
};

/// Checks whether the given type is a tuple expression.
template <class Expression>
class is_tuple_expr
{
private:
	typedef char yes[1];
	typedef char no[2];

	template <class Derived, class Element, size_t Count>
	static yes& check(const tuple_expr_mask<Derived, Element, Count>*);
	static no& check(...);

public:
	/// True, if Expression is a compatible tuple expression.
	static const bool value = (
		sizeof( check( static_cast<typename lean::strip_modref<Expression>::type*>(nullptr) ) )
		==
		sizeof(yes) );
};

/// Checks whether the given type has a compatible type.
template <class Expression>
class has_compatible_type
{
private:
	typedef char yes[1];
	typedef char no[2];

	template <class ActualExpression>
	static yes& check(const ActualExpression*, const typename lean::strip_modref<ActualExpression>::type::compatible_type* = nullptr);
	static no& check(...);

public:
	/// True, if Expression has got a compatible type.
	static const bool value = (
		sizeof( check( static_cast<typename lean::strip_modref<Expression>::type*>(nullptr) ) )
		==
		sizeof(yes) );
};

/// Redefines the given type as compatible_type.
template <class CompatibleType>
struct inh_compatible_type
{
	/// Compatible type.
	typedef CompatibleType compatible_type; 
};

template <class Expression, bool HasCompatibleType>
struct inh_compatible_type_of_impl { };
template <class Expression>
struct inh_compatible_type_of_impl<Expression, true>
	: public inh_compatible_type<typename lean::inh_strip_modref<Expression>::compatible_type> { };

/// Redefines the given expression's compatible_type, if available.
template <class Expression>
class inh_compatible_type_of :
	public inh_compatible_type_of_impl<Expression, has_compatible_type<Expression>::value> { };

template <class Operator, class LeftNCVR, class RightNCVR>
struct result_of_op_default { };
template <class Operator, class OperandsNCVR>
struct result_of_op_default<Operator, OperandsNCVR, OperandsNCVR>
{
	typedef OperandsNCVR type;
};

template <bool IsTupleExpr, class Operator, class Left, class Right = Left>
struct result_of_op_tuple_expr_route
	: public result_of_op_default<
		Operator,
		typename lean::strip_modref<Left>::type,
		typename lean::strip_modref<Right>::type> { };

/// Defines the result type of the given operator applied to the given operand types.
template <class Operator, class Left, class Right = Left>
struct result_of_op
	: public result_of_op_tuple_expr_route<
		is_tuple_expr<Left>::value || is_tuple_expr<Right>::value,
		Operator, Left, Right > { };

template <class Operator, class Left, class Right = Left>
struct result_of_subexpr_op
{
	typedef typename result_of_op<
		Operator,
		typename lean::inh_strip_modref<Left>::subexpr_type,
		typename lean::inh_strip_modref<Right>::subexpr_type >::type type;
};

/// Unary per-component expression.
template <
	class Operator, class Operand, class Accessor = acc_tuple,
	class Element = typename lean::inh_strip_modref<Operand>::value_type,
	size_t Count = lean::inh_strip_modref<Operand>::count,
	class SubExpression = typename result_of_subexpr_op<Operator, Operand>::type,
	class InhCompatibleType = inh_compatible_type_of<Operand> >
class unary_tuple_expr
	: public tuple_expr< unary_tuple_expr<Operator, Operand, Accessor, Element, Count, SubExpression, InhCompatibleType>, Element, Count, SubExpression >,
	public InhCompatibleType
{
	template <class A, class B, class C, class D, size_t E, class F, class G>
	friend class unary_tuple_expr;

private:
	typedef tuple_expr< unary_tuple_expr, Element, Count, SubExpression > base_type;

	Operand m_operand;

public:
	typedef typename lean::conditional_type<
		lean::strip_reference<Operand>::stripped,
		Operand,
		const Operand&>::type operand_reference;
	
	unary_tuple_expr(operand_reference operand)
		: m_operand(operand) { }
	// Persistent copy constructor
	template <class OperandMod, class SubExpressionMod, class InhCompatibleTypeMod>
	unary_tuple_expr(const unary_tuple_expr<Operator, OperandMod, Accessor, Element, Count, SubExpressionMod, InhCompatibleTypeMod> &mod)
		: m_operand(mod.m_operand)
	{ }

	typedef typename base_type::subexpr_type subexpr_type;
	typedef typename base_type::size_type size_type;

	LEAN_INLINE subexpr_type operator [](size_type n) const
	{
		return Operator::apply<subexpr_type>( Accessor::component<subexpr_type>(m_operand, n) );
	}
};

/// Binary per-component expression.
template <
	class Operator, class Left, class Right,
	class Element = typename lean::inh_strip_modref<Left>::value_type,
	size_t Count = lean::inh_strip_modref<Left>::count,
	class SubExpression = typename result_of_subexpr_op<Operator, Left, Right>::type,
	class InhCompatibleType = inh_compatible_type_of<Left> >
class binary_tuple_expr
	: public tuple_expr< binary_tuple_expr<Operator, Left, Right, Element, Count, SubExpression, InhCompatibleType>, Element, Count, SubExpression >,
	public InhCompatibleType
{
	template <class A, class B, class C, class D, size_t E, class F, class G>
	friend class binary_tuple_expr;

private:
	typedef tuple_expr< binary_tuple_expr, Element, Count, SubExpression > base_type;

	Left m_left;
	Right m_right;

public:
	typedef typename lean::conditional_type<
		lean::strip_reference<Left>::stripped,
		Left,
		const Left&>::type left_reference;
	typedef typename lean::conditional_type<
		lean::strip_reference<Right>::stripped,
		Right,
		const Right&>::type right_reference;

	binary_tuple_expr(left_reference left, right_reference right)
		: m_left(left),
		m_right(right) { }
	// Persistent copy constructor
	template <class LeftMod, class RightMod, class SubExpressionMod, class InhCompatibleTypeMod>
	binary_tuple_expr(const binary_tuple_expr<Operator, LeftMod, RightMod, Element, Count, SubExpressionMod, InhCompatibleTypeMod> &mod)
		: m_left(mod.m_left),
		m_right(mod.m_right)
	{ }

	typedef typename base_type::subexpr_type subexpr_type;
	typedef typename base_type::size_type size_type;

	LEAN_INLINE subexpr_type operator [](size_type n) const
	{
		return Operator::apply<subexpr_type>(m_left[n], m_right[n]);
	}
};

template <class OperandNMR, class Operand, class CoOperandNMR, class CoOperand>
struct wrap_scalar_tuple_expr_impl
{
	typedef Operand type;
};
template <class CoOperandNMR, class Compatible, class CoOperand>
struct wrap_scalar_tuple_expr_impl<typename CoOperandNMR::compatible_type, Compatible, CoOperandNMR, CoOperand>
{
	typedef unary_tuple_expr<
		op_identity, Compatible, acc_scalar,
		typename CoOperandNMR::value_type, CoOperandNMR::count, Compatible,
		inh_compatible_type_of<CoOperandNMR> > type;
};
template <class Operand, class CoOperand>
struct wrap_scalar_tuple_expr : public wrap_scalar_tuple_expr_impl<
	typename lean::strip_modref<Operand>::type, Operand,
	typename lean::strip_modref<CoOperand>::type, CoOperand> { };

template <class Operator, class Left, class Right>
struct binary_tuple_expr_t
{
	typedef binary_tuple_expr<Operator,
		typename wrap_scalar_tuple_expr<Left, Right>::type,
		typename wrap_scalar_tuple_expr<Right, Left>::type> type;
};

/// Defines the result type of the given operator applied to the given tuple expression types.
template <class Operator, class Left, class Right = Left>
struct result_of_op_tuple_expr
{
	typedef typename binary_tuple_expr_t<Operator, Left, Right>::type type;
};
template <class Operand>
struct result_of_op_tuple_expr<op_identity, Operand, Operand>
{
	typedef unary_tuple_expr<op_identity, Operand> type;
};
template <class Operand>
struct result_of_op_tuple_expr<op_negate, Operand, Operand>
{
	typedef unary_tuple_expr<op_negate, Operand> type;
};

// Redirect if expression contains tuple expressions
template <class Operator, class Left, class Right>
struct result_of_op_tuple_expr_route<true, Operator, Left, Right>
	: public result_of_op_tuple_expr<Operator, Left, Right> { };

/// Makes a unary tuple expression from the given tuple expressions.
template <class Operator, class Operand, class Element, size_t Count>
LEAN_INLINE typename result_of_op_tuple_expr<Operator, const Operand&>::type make_unary_tuple_expr(
	const tuple_expr_mask<Operand, Element, Count> &operand)
{
	return typename result_of_op_tuple_expr<Operator, const Operand&>::type( operand.expression() );
}
/// Makes a binary tuple expression from the given tuple expressions.
template <class Operator, class Left, class Right, class Element, size_t Count>
LEAN_INLINE typename result_of_op_tuple_expr<Operator, const Left&, const Right&>::type make_binary_tuple_expr(
	const tuple_expr_mask<Left, Element, Count> &left,
	const tuple_expr_mask<Right, Element, Count> &right)
{
	return typename result_of_op_tuple_expr<Operator, const Left&, const Right&>::type(
		left.expression(),
		right.expression() );
}

/// Negates the given value.
template <class Operand, class Element, size_t Count>
LEAN_INLINE typename result_of_op_tuple_expr<op_negate, const Operand&>::type operator -(
	const tuple_expr_mask<Operand, Element, Count> &operand)
{
	return make_unary_tuple_expr<op_negate>(operand);
}

/// Adds the given value to this values.
template <class Left, class Right, class Element, size_t Count>
LEAN_INLINE typename result_of_op_tuple_expr<op_add, const Left&, const Right&>::type operator +(
	const tuple_expr_mask<Left, Element, Count> &left,
	const tuple_expr_mask<Right, Element, Count> &right)
{
	return make_binary_tuple_expr<op_add>(left, right);
}

/// Subtracts the given right value from the given left value.
template <class Left, class Right, class Element, size_t Count>
LEAN_INLINE typename result_of_op_tuple_expr<op_subtract, const Left&, const Right&>::type operator -(
	const tuple_expr_mask<Left, Element, Count> &left,
	const tuple_expr_mask<Right, Element, Count> &right)
{
	return make_binary_tuple_expr<op_subtract>(left, right);
}

/// Multiplies the given left value by the given right value.
template <class Left, class Right, class Element, size_t Count>
LEAN_INLINE typename result_of_op_tuple_expr<op_multiply, const Left&, const Right&>::type operator *(
	const tuple_expr_mask<Left, Element, Count> &left,
	const tuple_expr_mask<Right, Element, Count> &right)
{
	return make_binary_tuple_expr<op_multiply>(left, right);
}

/// Multiplies the given left value by the given right value.
template <class Left, class Right, class Element, size_t Count>
LEAN_INLINE typename result_of_op_tuple_expr<op_divide, const Left&, const Right&>::type operator /(
	const tuple_expr_mask<Left, Element, Count> &left,
	const tuple_expr_mask<Right, Element, Count> &right)
{
	return make_binary_tuple_expr<op_divide>(left, right);
}

/// Multiplies the given left value by the given right value.
template <class Left, class Right, class Element, size_t Count>
LEAN_INLINE typename result_of_op_tuple_expr<op_modulo, const Left&, const Right&>::type operator %(
	const tuple_expr_mask<Left, Element, Count> &left,
	const tuple_expr_mask<Right, Element, Count> &right)
{
	return make_binary_tuple_expr<op_modulo>(left, right);
}

/// Makes a binary tuple expression from the given tuple expression and scalar.
template <class Operator, class Right, class Element, size_t Count>
LEAN_INLINE typename result_of_op_tuple_expr<Operator, const typename Right::compatible_type&, const Right&>::type make_binary_mixed_tuple_expr(
	const typename Right::compatible_type &left,
	const tuple_expr_mask<Right, Element, Count> &right)
{
	return typename result_of_op_tuple_expr<Operator, const typename Right::compatible_type&, const Right&>::type(
		typename wrap_scalar_tuple_expr<const typename Right::compatible_type&, Right>::type(left),
		right.expression() );
}
/// Makes a binary tuple expression from the given tuple expression and scalar.
template <class Operator, class Left, class Element, size_t Count>
LEAN_INLINE typename result_of_op_tuple_expr<Operator, const Left&, const typename Left::compatible_type&>::type make_binary_mixed_tuple_expr(
	const tuple_expr_mask<Left, Element, Count> &left,
	const typename Left::compatible_type &right)
{
	return typename result_of_op_tuple_expr<Operator, const Left&, const typename Left::compatible_type&>::type(
		left.expression(),
		typename wrap_scalar_tuple_expr<const typename Left::compatible_type&, Left>::type(right) );
}

/// Adds the given value to this values.
template <class Right, class Element, size_t Count>
LEAN_INLINE typename result_of_op_tuple_expr<op_add, const typename Right::compatible_type&, const Right&>::type operator +(
	const typename Right::compatible_type &left,
	const tuple_expr_mask<Right, Element, Count> &right)
{
	return make_binary_mixed_tuple_expr<op_add>(left, right);
}

/// Subtracts the given right value from the given left value.
template <class Right, class Element, size_t Count>
LEAN_INLINE typename result_of_op_tuple_expr<op_subtract, const typename Right::compatible_type&, const Right&>::type operator -(
	const typename Right::compatible_type &left,
	const tuple_expr_mask<Right, Element, Count> &right)
{
	return make_binary_mixed_tuple_expr<op_subtract>(left, right);
}

/// Multiplies the given left value by the given right value.
template <class Right, class Element, size_t Count>
LEAN_INLINE typename result_of_op_tuple_expr<op_multiply, const typename Right::compatible_type&, const Right&>::type operator *(
	const typename Right::compatible_type &left,
	const tuple_expr_mask<Right, Element, Count> &right)
{
	return make_binary_mixed_tuple_expr<op_multiply>(left, right);
}

/// Multiplies the given left value by the given right value.
template <class Right, class Element, size_t Count>
LEAN_INLINE typename result_of_op_tuple_expr<op_divide, const typename Right::compatible_type&, const Right&>::type operator /(
	const typename Right::compatible_type &left,
	const tuple_expr_mask<Right, Element, Count> &right)
{
	return make_binary_mixed_tuple_expr<op_divide>(left, right);
}

/// Multiplies the given left value by the given right value.
template <class Right, class Element, size_t Count>
LEAN_INLINE typename result_of_op_tuple_expr<op_modulo, const typename Right::compatible_type&, const Right&>::type operator %(
	const typename Right::compatible_type &left,
	const tuple_expr_mask<Right, Element, Count> &right)
{
	return make_binary_mixed_tuple_expr<op_modulo>(left, right);
}

/// Adds the given value to this values.
template <class Left, class Element, size_t Count>
LEAN_INLINE typename result_of_op_tuple_expr<op_add, const Left&, const typename Left::compatible_type&>::type operator +(
	const tuple_expr_mask<Left, Element, Count> &left,
	const typename Left::compatible_type &right)
{
	return make_binary_mixed_tuple_expr<op_add>(left, right);
}

/// Subtracts the given left value from the given right value.
template <class Left, class Element, size_t Count>
LEAN_INLINE typename result_of_op_tuple_expr<op_subtract, const Left&, const typename Left::compatible_type&>::type operator -(
	const tuple_expr_mask<Left, Element, Count> &left,
	const typename Left::compatible_type &right)
{
	return make_binary_mixed_tuple_expr<op_subtract>(left, right);
}

/// Multiplies the given right value by the given left value.
template <class Left, class Element, size_t Count>
LEAN_INLINE typename result_of_op_tuple_expr<op_multiply, const Left&, const typename Left::compatible_type&>::type operator *(
	const tuple_expr_mask<Left, Element, Count> &left,
	const typename Left::compatible_type &right)
{
	return make_binary_mixed_tuple_expr<op_multiply>(left, right);
}

/// Multiplies the given right value by the given left value.
template <class Left, class Element, size_t Count>
LEAN_INLINE typename result_of_op_tuple_expr<op_divide, const Left&, const typename Left::compatible_type&>::type operator /(
	const tuple_expr_mask<Left, Element, Count> &left,
	const typename Left::compatible_type &right)
{
	return make_binary_mixed_tuple_expr<op_divide>(left, right);
}

/// Multiplies the given right value by the given left value.
template <class Left, class Element, size_t Count>
LEAN_INLINE typename result_of_op_tuple_expr<op_modulo, const Left&, const typename Left::compatible_type&>::type operator %(
	const tuple_expr_mask<Left, Element, Count> &left,
	const typename Left::compatible_type &right)
{
	return make_binary_mixed_tuple_expr<op_modulo>(left, right);
}

} // namespace

using Impl::operator-;
using Impl::operator+;
using Impl::operator*;
using Impl::operator/;
using Impl::operator%;
No bullshit, C++!
alphanew.net (last updated 2011-07-02) | auf Twitter | Source Code: breeze 2 | lean C++ library | D3D Effects Lite
glassbear
Establishment
Beiträge: 324
Registriert: 08.04.2003, 18:09
Alter Benutzername: Enrico_
Echter Name: Enrico
Wohnort: San Diego
Kontaktdaten:

Re: Jammer-Thread

Beitrag von glassbear »

CodingCat hat geschrieben:Nur wenige Wochen später stellte man sich die Frage, ob die damit einhergehende leicht erhöhte Komplexität und stellenweise Undurchdringlichkeit beim Debuggen denn wirklich durch das Sparen von etwa 10% der Recheninstruktionen gerechtfertigt wäre.
No bullshit, C++!
Für mich: Absolut nicht gerechtfertigt.

Unsere Architekten finden das auch gaaaanz toll. Kommt ja auch automatisch generiert (mit super Namen wie f2485676()) aus den Tools. Debuggen brauchen die das nicht ja, wenn auf den 10+ Abstraktionslayern was schief geht und sich eine Fehlermeldung über viele Seiten erstreckt :evil: :evil: :evil: :evil: :evil:
Ein Hoch auf uns Männer... Auf die Frau, die uns HAT ( oder hat, und nicht weiß, dass sie uns hat ) ...auf die Idiotinnen ... besser gesagt VOLLPFOSTINNEN ... die uns hatten und uns verloren haben ... und auf die GLÜCKLICHEN, die das Vergnügen & Glück haben werden uns kennenzulernen!
Benutzeravatar
CodingCat
Establishment
Beiträge: 1857
Registriert: 02.03.2009, 21:25
Wohnort: Student @ KIT
Kontaktdaten:

Re: Jammer-Thread

Beitrag von CodingCat »

Nachdem ich die letzten Wochen beim Programmieren gleich auf eine ganze Latte neuer Bugs im VC++ 2010 Compiler gestoßen bin, und der heutige Tag nach endloser Fehlersuche (verursacht durch den letzten) eh schon im Eimer war, war der Frust mal wieder groß genug, entsprechende Bug-Reports aufzusetzen. Upvoten erwünscht.
Und weil sich hier immer noch nix tut: 7 Bug-Reports in gerade mal 5 Monaten ernsthaftem C++, und das mit einem derart "gereiften" Compiler. GCC hat bisher übrigens alle Test-Cases fehlerfrei überstanden.
alphanew.net (last updated 2011-07-02) | auf Twitter | Source Code: breeze 2 | lean C++ library | D3D Effects Lite
Benutzeravatar
Schrompf
Moderator
Beiträge: 4885
Registriert: 25.02.2009, 23:44
Benutzertext: Lernt nur selten dazu
Echter Name: Thomas Ziegenhagen
Wohnort: Dresden
Kontaktdaten:

Re: Jammer-Thread

Beitrag von Schrompf »

Der Text-Speicherüberschreiber ist wieder da :-(

In einem von 100 Fällen, wenn gleichzeitig auf einem Zweitkern ein optionaler Shader und auf dem D3D-verantwortlichen Kern ein Sofort-Shader vom selben Effekt generiert werden, durchmischen sich die beiden Shader-Quelltexte und die Übersetzung schlägt fehl. Und ich hab keinen blassen, warum das so ist. Keinerlei statische Variablen oder wiederverwendete Instanzen. Und ich kann den Fehler auch nicht provozieren, indem ich an kritischen Stellen Pausen einbaue.

Wenn ich mal groß bin, schreibe ich ordentlichen parallelen Code.
Früher mal Dreamworlds. Früher mal Open Asset Import Library. Heutzutage nur noch so rumwursteln.
Benutzeravatar
Chromanoid
Moderator
Beiträge: 4263
Registriert: 16.10.2002, 19:39
Echter Name: Christian Kulenkampff
Wohnort: Lüneburg

Re: Jammer-Thread

Beitrag von Chromanoid »

Vielleicht benutzen die Dinger "gemeinsame" temporäre Dateien?
Benutzeravatar
Schrompf
Moderator
Beiträge: 4885
Registriert: 25.02.2009, 23:44
Benutzertext: Lernt nur selten dazu
Echter Name: Thomas Ziegenhagen
Wohnort: Dresden
Kontaktdaten:

Re: Jammer-Thread

Beitrag von Schrompf »

Maaaaaann! Christian! Sag das doch eher. Grad eben hab ich den Bastard selbst gefunden.

Die Shader-Compile-Funktion arbeitet ja praktisch immer mit im Programm generiertem Quelltext. Um trotzdem sinnvoll Warnungen und Fehler zuordnen zu können, wird jeder Shader auf Wunsch in eine temporäre Datei geschrieben und dann mit D3DXCompileShaderFromFile() übersetzt. Und der Zähler zur Ermittlung immer neuer Dateinamen war nicht gesichert, so dass manches Mal zwei parallel kompilierte Shader ins gleiche temporäre File geschrieben haben. Wodurch alle möglichen wirren Quelltext-Konstrukte kompiliert wurden. Jetzt ist der Zähler ein tbb::atomic<size_t> und alles ist gut.

Trotzdem Danke für den Tipp :-)
Früher mal Dreamworlds. Früher mal Open Asset Import Library. Heutzutage nur noch so rumwursteln.
Benutzeravatar
CodingCat
Establishment
Beiträge: 1857
Registriert: 02.03.2009, 21:25
Wohnort: Student @ KIT
Kontaktdaten:

Re: Jammer-Thread

Beitrag von CodingCat »

Mein Rechner (Vista, 2 GiB RAM) fährt mit 73% Auslastung des Arbeitsspeichers hoch. Nach vollständigem Abschluss der Ladephase bleiben 46%, davon alleine 100+ MiB Antivir, 100 MiB DWM + Treiberframework, 100 MiB Explorer + Search Indexer... weil Speicher heute unerschöpflich ist.
alphanew.net (last updated 2011-07-02) | auf Twitter | Source Code: breeze 2 | lean C++ library | D3D Effects Lite
Benutzeravatar
Krishty
Establishment
Beiträge: 8268
Registriert: 26.02.2009, 11:18
Benutzertext: state is the enemy
Kontaktdaten:

Re: Jammer-Thread

Beitrag von Krishty »

seziert Ace Combat, Driver, und S.T.A.L.K.E.R.   —   rendert Sterne
glassbear
Establishment
Beiträge: 324
Registriert: 08.04.2003, 18:09
Alter Benutzername: Enrico_
Echter Name: Enrico
Wohnort: San Diego
Kontaktdaten:

Re: Jammer-Thread

Beitrag von glassbear »

CodingCat hat geschrieben:Mein Rechner (Vista, 2 GiB RAM) fährt mit 73% Auslastung des Arbeitsspeichers hoch. Nach vollständigem Abschluss der Ladephase bleiben 46%, davon alleine 100+ MiB Antivir, 100 MiB DWM + Treiberframework, 100 MiB Explorer + Search Indexer... weil Speicher heute unerschöpflich ist.
Soll ich dir welchen schenken guenstig verkaufen? :mrgreen:
Ein Hoch auf uns Männer... Auf die Frau, die uns HAT ( oder hat, und nicht weiß, dass sie uns hat ) ...auf die Idiotinnen ... besser gesagt VOLLPFOSTINNEN ... die uns hatten und uns verloren haben ... und auf die GLÜCKLICHEN, die das Vergnügen & Glück haben werden uns kennenzulernen!
Benutzeravatar
eXile
Establishment
Beiträge: 1136
Registriert: 28.02.2009, 13:27

Re: Jammer-Thread

Beitrag von eXile »

CodingCat hat geschrieben:Mein Rechner (Vista, 2 GiB RAM) fährt mit 73% Auslastung des Arbeitsspeichers hoch. Nach vollständigem Abschluss der Ladephase bleiben 46%, davon alleine 100+ MiB Antivir, 100 MiB DWM + Treiberframework, 100 MiB Explorer + Search Indexer... weil Speicher heute unerschöpflich ist.
Damit dieser Post auch konstruktiv ist: Ich habe mit Microsoft Security Essentials extrem gute Erfahrungen gemacht. Läuft hier gerade mit 60 MiB.
Bild
U mad
kaiserludi
Establishment
Beiträge: 467
Registriert: 18.04.2002, 15:31

Re: Jammer-Thread

Beitrag von kaiserludi »

Argh, wieso gibts Xcode in objC nicht mal ein Warning, wenn man einen Dictionary-array ohne expliziten Cast als Parameter übergibt (als pointer 32bit auf einem 32bit-system), obwohl die Methode einen bool verlangt (8bit auf Apple-Plattformen)? Kompiliert alles anstandslos und zur Laufzeit: *boom*
"Mir ist auch klar, dass der Tag, an dem ZFX und Developia zusammengehen werden der selbe Tag sein wird, an dem DirectGL rauskommt."
DirectGL, endlich ist es da
:)

"According to the C++ standard, it's "undefined". That's a technical term that means, in theory, anything can happen: the program can crash, or keep running but generate garbage results, or send Bjarne Stroustrup an e-mail saying how ugly you are and how funny your mother dresses you." :shock:[/size]
j.klugmann
Establishment
Beiträge: 201
Registriert: 07.07.2010, 13:00
Kontaktdaten:

Re: Jammer-Thread

Beitrag von j.klugmann »

Weil Apple scheiße ist. :) *we didn't start the flamewar...*
Imaging-Software und bald auch Middleware: http://fd-imaging.com
Benutzeravatar
Chromanoid
Moderator
Beiträge: 4263
Registriert: 16.10.2002, 19:39
Echter Name: Christian Kulenkampff
Wohnort: Lüneburg

Re: Jammer-Thread

Beitrag von Chromanoid »

Objective-C und XCode kommen aus der Hölle um uns zu holen. Und das alles nur aus lizenzrechtlichen Gründen :evil:
mikesc
Beiträge: 28
Registriert: 07.03.2009, 23:12
Wohnort: Augsburg
Kontaktdaten:

Re: Jammer-Thread

Beitrag von mikesc »

CodingCat hat geschrieben:... Search Indexer ...
Falls es jemand noch nicht kennen sollte: http://www.voidtools.com/, schlägt die Windows-Suche/Indizierung um Längen (solange du nicht nach Dateiinhalten suchst).
Benutzeravatar
CodingCat
Establishment
Beiträge: 1857
Registriert: 02.03.2009, 21:25
Wohnort: Student @ KIT
Kontaktdaten:

Re: Jammer-Thread

Beitrag von CodingCat »

Ich suche überhaupt nicht. Ich kriege dieses Mistvieh nur nie ganz tot.
alphanew.net (last updated 2011-07-02) | auf Twitter | Source Code: breeze 2 | lean C++ library | D3D Effects Lite
Benutzeravatar
eXile
Establishment
Beiträge: 1136
Registriert: 28.02.2009, 13:27

Re: Jammer-Thread

Beitrag von eXile »

Und wenn man gar keine indizierte Suche will: grepWin
glassbear
Establishment
Beiträge: 324
Registriert: 08.04.2003, 18:09
Alter Benutzername: Enrico_
Echter Name: Enrico
Wohnort: San Diego
Kontaktdaten:

Re: Jammer-Thread

Beitrag von glassbear »

Yay, Trip nach San Diego und Irvine wurde vom Chef gerade abgesagt :cry: :cry: :cry:
Ein Hoch auf uns Männer... Auf die Frau, die uns HAT ( oder hat, und nicht weiß, dass sie uns hat ) ...auf die Idiotinnen ... besser gesagt VOLLPFOSTINNEN ... die uns hatten und uns verloren haben ... und auf die GLÜCKLICHEN, die das Vergnügen & Glück haben werden uns kennenzulernen!
Benutzeravatar
Jonathan
Establishment
Beiträge: 2395
Registriert: 04.08.2004, 20:06
Kontaktdaten:

Re: Jammer-Thread

Beitrag von Jonathan »

mikesc hat geschrieben:
CodingCat hat geschrieben:... Search Indexer ...
Falls es jemand noch nicht kennen sollte: http://www.voidtools.com/, schlägt die Windows-Suche/Indizierung um Längen (solange du nicht nach Dateiinhalten suchst).
Danke. Bei mir findet die Windowssuche nämlich einfach mal GAR NIX, selbst wenn man im richtigen Ordner ist. Keine Ahnung, wie man so was einfaches wie eine Suchfunktion versauen kann, aber Windows 7 schafft es...
Lieber dumm fragen, als dumm bleiben!
https://jonathank.de/games/
joggel

Re: Jammer-Thread

Beitrag von joggel »

Irgendwie finde ich ClanLib garnicht mehr so gut :(...
Die Benutzung erschliest sich mir immer komplitzierter und der Support über Foren ist auch eher mäßig...
Benutzeravatar
Krishty
Establishment
Beiträge: 8268
Registriert: 26.02.2009, 11:18
Benutzertext: state is the enemy
Kontaktdaten:

Re: Jammer-Thread

Beitrag von Krishty »

Bild
seziert Ace Combat, Driver, und S.T.A.L.K.E.R.   —   rendert Sterne
Benutzeravatar
Krishty
Establishment
Beiträge: 8268
Registriert: 26.02.2009, 11:18
Benutzertext: state is the enemy
Kontaktdaten:

Re: Jammer-Thread

Beitrag von Krishty »

Chrome hat keinen Offline-Modus.
seziert Ace Combat, Driver, und S.T.A.L.K.E.R.   —   rendert Sterne
joggel

Re: Jammer-Thread

Beitrag von joggel »

:(
Vorher
Vorher
Ist nur ein Ausschnitt... => *klick*
Benutzeravatar
Chromanoid
Moderator
Beiträge: 4263
Registriert: 16.10.2002, 19:39
Echter Name: Christian Kulenkampff
Wohnort: Lüneburg

Re: Jammer-Thread

Beitrag von Chromanoid »

Wieso hatte ich eben unlöschbare Dateien auf meinem Rechner? Die Dinger sind durch Git/TortoiseGit entstanden und ich konnte sie erst durch das Programm Unlocker entfernen. cacls und Co. haben irgendwie nicht funktioniert und der process explorer hat keine handles angezeigt. Ich wüsste gerne mal was ich vergessen habe, dass es unlocker konnte und ich nicht -.- In meiner wütenden Ungeduld habe ich natürlich übersehen, dass der unlocker auch gleich noch ne Toolbar installiert ARRRR :evil: :evil:
Bild
Benutzeravatar
Schrompf
Moderator
Beiträge: 4885
Registriert: 25.02.2009, 23:44
Benutzertext: Lernt nur selten dazu
Echter Name: Thomas Ziegenhagen
Wohnort: Dresden
Kontaktdaten:

Re: Jammer-Thread

Beitrag von Schrompf »

Krishty hat da einen schönen FlowChart gepostet, den man bei passender Gelegenheit wieder rausholen kann. Die Frage kommt ja doch gelegentlich...

Mein aktueller Jammer: es reicht bereits, boost::signal nur zu inkludieren und schon steigt Visual Studio wegen erreichter Heap-Grenzen aus. Weichei, verdammtes.
Früher mal Dreamworlds. Früher mal Open Asset Import Library. Heutzutage nur noch so rumwursteln.
Antworten