Skip to main content
GameDev.net gamedev.net
🔒 Locked

HLSL Problem

Started by asvsfs Jan 5, 2009 at 5:54 AM 2 replies 1.7k views
Original Post
asvsfs
asvsfs
(sry for bad eng) hi i can't run my directx code and this is the first time i use HLSL and my windows appear black and it crash on this line RUntime effect->FindNextValidTechnique(NULL, &technique); first i changed my createdevice function from d3d->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, 0, &d3dpp, &d3ddev); to d3d->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &d3ddev); I read this from a site but nothing happend and my program just crashed at the same line thx
Evil Steve
Evil Steve
If it's crashing, you're not checking return values. You need to check (with the SUCCEEDED or FAILED macro) that the function succeeded.

Also, the Debug Runtimes will tell you what's going wrong.
asvsfs
asvsfs
This is my debug output

'HLSL.exe': Loaded 'C:\Documents and Settings\Asvsfs\My Documents\Visual Studio 2005\Projects\HLSL\debug\HLSL.exe', Symbols loaded.
'HLSL.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', No symbols loaded.
'HLSL.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', No symbols loaded.
'HLSL.exe': Loaded 'C:\WINDOWS\system32\user32.dll', No symbols loaded.
'HLSL.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll', No symbols loaded.
'HLSL.exe': Loaded 'C:\WINDOWS\system32\D3dx9d_39.dll', No symbols loaded.
'HLSL.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll', No symbols loaded.
'HLSL.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll', No symbols loaded.
'HLSL.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll', No symbols loaded.
'HLSL.exe': Loaded 'C:\WINDOWS\system32\d3d9.dll', No symbols loaded.
'HLSL.exe': Loaded 'C:\WINDOWS\system32\d3d8thk.dll', No symbols loaded.
'HLSL.exe': Loaded 'C:\WINDOWS\system32\version.dll', No symbols loaded.
'HLSL.exe': Loaded 'C:\WINDOWS\system32\winmm.dll', No symbols loaded.
'HLSL.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_5490cd9f\msvcr80d.dll', Symbols loaded.
'HLSL.exe': Loaded 'C:\WINDOWS\system32\imm32.dll', No symbols loaded.
'HLSL.exe': Loaded 'C:\WINDOWS\system32\lpk.dll', No symbols loaded.
'HLSL.exe': Loaded 'C:\WINDOWS\system32\usp10.dll', No symbols loaded.
'HLSL.exe': Loaded 'C:\WINDOWS\system32\avgrsstx.dll', No symbols loaded.
'HLSL.exe': Loaded 'C:\Program Files\Common Files\Logitech\LVMVFM\LVPrcInj.dll', No symbols loaded.
The thread 'Win32 Thread' (0x3964) has exited with code 16318464 (0xf90000).
'HLSL.exe': Loaded 'C:\WINDOWS\system32\uxtheme.dll', No symbols loaded.
'HLSL.exe': Loaded 'C:\WINDOWS\system32\msctf.dll', No symbols loaded.
'HLSL.exe': Loaded 'C:\WINDOWS\system32\MSCTFIME.IME', No symbols loaded.
'HLSL.exe': Loaded 'C:\WINDOWS\system32\ole32.dll', No symbols loaded.
'HLSL.exe': Loaded 'C:\WINDOWS\system32\d3d9d.dll', No symbols loaded.
'HLSL.exe': Loaded 'C:\WINDOWS\system32\d3dx9d_33.dll', No symbols loaded.
Direct3D9: :====> ENTER: DLLMAIN(0103e6e0): Process Attach: 00003fa8, tid=00003c3c
Direct3D9: :====> EXIT: DLLMAIN(0103e6e0): Process Attach: 00003fa8
Direct3D9: (INFO) :Direct3D9 Debug Runtime selected.
D3D9 Helper: Enhanced D3DDebugging disabled; Application was not compiled with D3D_DEBUG_INFO
Direct3D9: (INFO) :======================= Hal SWVP device selected

Direct3D9: (INFO) :HalDevice Driver style 9

Direct3D9: :BackBufferCount not specified, considered default 1
Direct3D9: :Subclassing window 002d0b1c
Direct3D9: :StartExclusiveMode
Direct3D9: :WM_DISPLAYCHANGE: 640x480x32
Direct3D9: (INFO) :Using P4 PSGP

dxtshader.fx(11,11): error X3000: syntax error: unexpected token 'VertexShader'
First-chance exception at 0x004118a6 in HLSL.exe: 0xC0000005: Access violation reading location 0x00000000.
Unhandled exception at 0x004118a6 in HLSL.exe: 0xC0000005: Access violation reading location 0x00000000.
The program '[16296] HLSL.exe: Native' has exited with code 0 (0x0).
Evil Steve
Evil Steve
Quote:
Original post by asvsfs
dxtshader.fx(11,11): error X3000: syntax error: unexpected token 'VertexShader'
Well there's your problem.

The access violation is because you're not correctly checking if compiling the shader succeeded.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.