port from perforce
This commit is contained in:
296
hgplus/las/framework-dx11-nasm/b288.asm
Normal file
296
hgplus/las/framework-dx11-nasm/b288.asm
Normal file
@@ -0,0 +1,296 @@
|
||||
; b288.asm - las/mercury
|
||||
[BITS 32]
|
||||
;---
|
||||
%define WIDTH 1280
|
||||
%define HEIGHT 720
|
||||
%ifdef DEBUG
|
||||
%else
|
||||
%define FULLSCREEN
|
||||
%endif
|
||||
;---
|
||||
%include "inc/macros.inc"
|
||||
%include "inc/windows.inc"
|
||||
%include "inc/dxgi.inc"
|
||||
%include "inc/d3d11.inc"
|
||||
;---
|
||||
struc TEXTURE_2D_SRV_UAV_RTV
|
||||
.TEX: resd 1
|
||||
.SRV: resd 1
|
||||
.UAV: resd 1
|
||||
.RTV: resd 1
|
||||
endstruc
|
||||
;---
|
||||
DATA_SECTION WFMTEX
|
||||
_waveFormatEx:
|
||||
istruc WAVEFORMATEX
|
||||
at WAVEFORMATEX.wFormatTag, dw WAVE_FORMAT_IEEE_FLOAT
|
||||
at WAVEFORMATEX.nChannels, dw 2
|
||||
at WAVEFORMATEX.nSamplesPerSec, dd 44100
|
||||
at WAVEFORMATEX.nAvgBytesPerSec, dd 44100*4*2
|
||||
at WAVEFORMATEX.nBlockAlign, dw 4*2
|
||||
at WAVEFORMATEX.wBitsPerSample, dw 4*8
|
||||
at WAVEFORMATEX.cbSize, dw 0
|
||||
iend
|
||||
|
||||
DATA_SECTION WHDR
|
||||
_waveHdr:
|
||||
istruc WAVEHDR
|
||||
at WAVEHDR.lpData, dd _sndBuffer
|
||||
at WAVEHDR.dwBufferLength, dd _sndBufferEnd-_sndBuffer
|
||||
at WAVEHDR.dwBytesRecorded, dd 0
|
||||
at WAVEHDR.dwUser, dd 0
|
||||
at WAVEHDR.dwFlags, dd WHDR_PREPARED
|
||||
at WAVEHDR.dwLoops, dd 0
|
||||
at WAVEHDR.lpNext, dd 0
|
||||
at WAVEHDR.reserved, dd 0
|
||||
iend
|
||||
|
||||
DATA_SECTION TIME
|
||||
_mmTime:
|
||||
istruc MMTIME
|
||||
at MMTIME.wType, dd TIME_SAMPLES
|
||||
at MMTIME.data, dd 0
|
||||
iend
|
||||
|
||||
DATA_SECTION SC_DESC
|
||||
_swapChainDesc:
|
||||
istruc DXGI_SWAP_CHAIN_DESC
|
||||
at DXGI_SWAP_CHAIN_DESC.Width, dd WIDTH
|
||||
at DXGI_SWAP_CHAIN_DESC.Height, dd HEIGHT
|
||||
at DXGI_SWAP_CHAIN_DESC.Numerator, dd 0
|
||||
at DXGI_SWAP_CHAIN_DESC.Denominator, dd 1
|
||||
at DXGI_SWAP_CHAIN_DESC.Format, dd DXGI_FORMAT_R16G16B16A16_FLOAT
|
||||
at DXGI_SWAP_CHAIN_DESC.ScanlineOrdering, dd DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED
|
||||
at DXGI_SWAP_CHAIN_DESC.Scaling, dd DXGI_MODE_SCALING_UNSPECIFIED
|
||||
at DXGI_SWAP_CHAIN_DESC.Count, dd 1
|
||||
at DXGI_SWAP_CHAIN_DESC.Quality, dd 0
|
||||
at DXGI_SWAP_CHAIN_DESC.BufferUsage, dd DXGI_USAGE_RENDER_TARGET_OUTPUT | DXGI_USAGE_UNORDERED_ACCESS | DXGI_USAGE_SHADER_INPUT
|
||||
at DXGI_SWAP_CHAIN_DESC.BufferCount, dd 1
|
||||
at DXGI_SWAP_CHAIN_DESC.OutputWindow, dd 0
|
||||
%ifdef FULLSCREEN
|
||||
at DXGI_SWAP_CHAIN_DESC.Windowed, dd 0
|
||||
%else
|
||||
at DXGI_SWAP_CHAIN_DESC.Windowed, dd 0xffffffff
|
||||
%endif
|
||||
at DXGI_SWAP_CHAIN_DESC.SwapEffect, dd DXGI_SWAP_EFFECT_DISCARD
|
||||
at DXGI_SWAP_CHAIN_DESC.Flags, dd 0
|
||||
iend
|
||||
|
||||
DATA_SECTION TEX_DESC
|
||||
_textureDesc:
|
||||
istruc D3D11_TEXTURE2D_DESC
|
||||
at D3D11_TEXTURE2D_DESC.Width, dd 0
|
||||
at D3D11_TEXTURE2D_DESC.Height, dd 0
|
||||
at D3D11_TEXTURE2D_DESC.MipLevels, dd 0
|
||||
at D3D11_TEXTURE2D_DESC.ArraySize, dd 1
|
||||
at D3D11_TEXTURE2D_DESC.Format, dd DXGI_FORMAT_R16G16B16A16_FLOAT
|
||||
at D3D11_TEXTURE2D_DESC.Count, dd 1
|
||||
at D3D11_TEXTURE2D_DESC.Quality, dd 0
|
||||
at D3D11_TEXTURE2D_DESC.Usage, dd D3D11_USAGE_DEFAULT
|
||||
at D3D11_TEXTURE2D_DESC.BindFlags, dd D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_UNORDERED_ACCESS
|
||||
at D3D11_TEXTURE2D_DESC.CPUAccessFlags, dd 0
|
||||
at D3D11_TEXTURE2D_DESC.MiscFlags, dd D3D11_RESOURCE_MISC_GENERATE_MIPS
|
||||
iend
|
||||
|
||||
DATA_SECTION UUID
|
||||
_uuidTexture2D:
|
||||
dd 0x6f15aaf2
|
||||
dw 0xd208
|
||||
dw 0x4e89
|
||||
db 0x9a,0xb4,0x48,0x95,0x35,0xd3,0x4f,0x9c
|
||||
|
||||
DATA_SECTION SHADER
|
||||
_src:
|
||||
incbin "gpu/b288.hlsl"
|
||||
db 0
|
||||
_srcEnd:
|
||||
_entrypoint:
|
||||
db "cs", 0
|
||||
_target:
|
||||
db "cs_5_0", 0
|
||||
_null:
|
||||
dd 0
|
||||
|
||||
BSS_SECTION SND
|
||||
_sndBuffer: resd 16384*4
|
||||
_sndBufferEnd:
|
||||
_waveHandle: resd 1024
|
||||
|
||||
BSS_SECTION D3D
|
||||
_device: resd 1
|
||||
_context: resd 1
|
||||
_swapChain: resd 1
|
||||
_backBufferTexture: resd 1
|
||||
_backBufferUAV: resd 1
|
||||
_computeShader: resd 1
|
||||
_blob: resd 1
|
||||
|
||||
BSS_SECTION RES
|
||||
_textureSRVUAVRTV: resb TEXTURE_2D_SRV_UAV_RTV_size
|
||||
|
||||
TEXT_SECTION SUR
|
||||
_createSRVUAVRTV: ; target, width, height
|
||||
pop eax
|
||||
pop edi
|
||||
pop dword [_textureDesc + D3D11_TEXTURE2D_DESC.Width]
|
||||
pop dword [_textureDesc + D3D11_TEXTURE2D_DESC.Height]
|
||||
push eax
|
||||
|
||||
lea eax, [edi + TEXTURE_2D_SRV_UAV_RTV.TEX]
|
||||
push eax
|
||||
push byte 0
|
||||
push dword _textureDesc
|
||||
com _device, ID3D11Device.CreateTexture2D
|
||||
|
||||
lea eax, [edi + TEXTURE_2D_SRV_UAV_RTV.SRV]
|
||||
push eax
|
||||
push byte 0
|
||||
push dword [edi + TEXTURE_2D_SRV_UAV_RTV.TEX]
|
||||
com _device, ID3D11Device.CreateShaderResourceView
|
||||
|
||||
lea eax, [edi + TEXTURE_2D_SRV_UAV_RTV.UAV]
|
||||
push eax
|
||||
push byte 0
|
||||
push dword [edi + TEXTURE_2D_SRV_UAV_RTV.TEX]
|
||||
com _device, ID3D11Device.CreateUnorderedAccessView
|
||||
|
||||
lea eax, [edi + TEXTURE_2D_SRV_UAV_RTV.RTV]
|
||||
push eax
|
||||
push byte 0
|
||||
push dword [edi + TEXTURE_2D_SRV_UAV_RTV.TEX]
|
||||
com _device, ID3D11Device.CreateRenderTargetView
|
||||
ret
|
||||
|
||||
TEXT_SECTION MAINLOOP
|
||||
global _start
|
||||
_start:
|
||||
%ifdef FULLSCREEN
|
||||
push byte 0
|
||||
push byte 0
|
||||
push byte 0
|
||||
push byte 0
|
||||
push byte 0
|
||||
push byte 0
|
||||
push byte 0
|
||||
push byte 0
|
||||
push byte 0
|
||||
push dword WS_POPUP | WS_VISIBLE | WS_MAXIMIZE
|
||||
push byte 0
|
||||
push dword ATOM_STATIC
|
||||
push byte 0
|
||||
%else
|
||||
push byte 0
|
||||
push byte 0
|
||||
push byte 0
|
||||
push byte 0
|
||||
push dword HEIGHT
|
||||
push dword WIDTH
|
||||
push byte 0
|
||||
push byte 0
|
||||
push dword WS_POPUP | WS_VISIBLE
|
||||
push byte 0
|
||||
push dword ATOM_STATIC
|
||||
push byte 0
|
||||
%endif
|
||||
call _CreateWindowExA@48
|
||||
mov [_swapChainDesc + DXGI_SWAP_CHAIN_DESC.OutputWindow], eax
|
||||
%ifdef FULLSCREEN
|
||||
call _ShowCursor@4
|
||||
%endif
|
||||
push dword _context
|
||||
push byte 0
|
||||
push dword _device
|
||||
push dword _swapChain
|
||||
push dword _swapChainDesc
|
||||
push byte D3D11_SDK_VERSION
|
||||
push byte 0
|
||||
push byte 0
|
||||
push byte 0
|
||||
push byte 0
|
||||
push byte D3D_DRIVER_TYPE_HARDWARE
|
||||
push byte 0
|
||||
call _D3D11CreateDeviceAndSwapChain@48
|
||||
|
||||
push byte 0
|
||||
push dword _blob
|
||||
push byte 0
|
||||
push dword D3DCOMPILE_OPTIMIZATION_LEVEL3
|
||||
push dword _target
|
||||
push dword _entrypoint
|
||||
push byte 0
|
||||
push byte 0
|
||||
push byte 0
|
||||
push dword _srcEnd-_src
|
||||
push dword _src
|
||||
call _D3DCompile@44
|
||||
|
||||
push dword _computeShader
|
||||
push byte 0
|
||||
com _blob, ID3D10Blob.GetBufferSize
|
||||
push eax
|
||||
com _blob, ID3D10Blob.GetBufferPointer
|
||||
push eax
|
||||
com _device, ID3D11Device.CreateComputeShader
|
||||
|
||||
push dword _backBufferTexture
|
||||
push dword _uuidTexture2D
|
||||
push byte 0
|
||||
com _swapChain, IDXGISwapChain.GetBuffer
|
||||
|
||||
push dword _backBufferUAV
|
||||
push byte 0
|
||||
push dword [_backBufferTexture]
|
||||
com _device, ID3D11Device.CreateUnorderedAccessView
|
||||
|
||||
push byte 0
|
||||
push byte 0
|
||||
push dword [_computeShader]
|
||||
com _context, ID3D11DeviceContext.CSSetShader
|
||||
|
||||
push dword WIDTH
|
||||
push dword HEIGHT
|
||||
push dword _textureSRVUAVRTV
|
||||
call _createSRVUAVRTV
|
||||
|
||||
_initSound:
|
||||
push byte 0
|
||||
push byte 0
|
||||
push byte 0
|
||||
push dword _waveFormatEx
|
||||
push byte WAVE_MAPPER
|
||||
push dword _waveHandle
|
||||
call _waveOutOpen@24
|
||||
|
||||
push byte WAVEHDR_size
|
||||
push dword _waveHdr
|
||||
push dword [_waveHandle]
|
||||
call _waveOutWrite@12
|
||||
|
||||
_mainloop:
|
||||
push byte MMTIME_size
|
||||
push dword _mmTime
|
||||
push dword [_waveHandle]
|
||||
call _waveOutGetPosition@12
|
||||
|
||||
push byte 0
|
||||
push dword _backBufferUAV
|
||||
push byte 1
|
||||
push byte 0
|
||||
com _context, ID3D11DeviceContext.CSSetUnorderedAccessViews
|
||||
|
||||
push byte 1
|
||||
push byte 45
|
||||
push byte 80
|
||||
com _context, ID3D11DeviceContext.Dispatch
|
||||
|
||||
push byte 0
|
||||
push byte 1
|
||||
com _swapChain, IDXGISwapChain.Present
|
||||
|
||||
push byte VK_ESCAPE
|
||||
call _GetAsyncKeyState@4
|
||||
dec eax
|
||||
js short _mainloop
|
||||
_end:
|
||||
push eax
|
||||
call _ExitProcess@4
|
||||
6
hgplus/las/framework-dx11-nasm/console.bat
Normal file
6
hgplus/las/framework-dx11-nasm/console.bat
Normal file
@@ -0,0 +1,6 @@
|
||||
@echo off
|
||||
set PATH=.\tools\glfnGenerator\Release;.\tools\;%PATH%
|
||||
set PATH=C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x86;%PATH%
|
||||
set PATH=%CUDA_PATH%\lib\Win32;%PATH%
|
||||
call "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\vcvars32.bat"
|
||||
cmd
|
||||
1
hgplus/las/framework-dx11-nasm/gpu/b288.hlsl
Normal file
1
hgplus/las/framework-dx11-nasm/gpu/b288.hlsl
Normal file
@@ -0,0 +1 @@
|
||||
RWTexture2D<float4>_:register(u0);[numthreads(16,16,1)]void cs(uint3 id:SV_DispatchThreadID){_[id.xy]=float4(1,id.xy/float2(1280,720),1);}
|
||||
121
hgplus/las/framework-dx11-nasm/inc/cuda.inc
Normal file
121
hgplus/las/framework-dx11-nasm/inc/cuda.inc
Normal file
@@ -0,0 +1,121 @@
|
||||
; cuda.inc - las/mercury
|
||||
|
||||
; nvcuda
|
||||
extern _cuInit@4
|
||||
|
||||
extern _cuDeviceGet@8
|
||||
extern _cuDeviceGetCount@4
|
||||
extern _cuDeviceGetName@12
|
||||
|
||||
%define _cuDeviceTotalMem@8 _cuDeviceTotalMem_v2@8
|
||||
extern _cuDeviceTotalMem@8
|
||||
|
||||
extern _cuDeviceComputeCapability@12
|
||||
|
||||
%define _cuCtxCreate@12 _cuCtxCreate_v2@12
|
||||
extern _cuCtxCreate@12
|
||||
|
||||
extern _cuModuleGetFunction@12
|
||||
%define _cuModuleGetGlobal@16 _cuModuleGetGlobal_v2@16
|
||||
extern _cuModuleGetGlobal@16
|
||||
extern _cuModuleGetSurfRef@12
|
||||
extern _cuModuleGetTexRef@12
|
||||
extern _cuModuleLoad@8
|
||||
extern _cuModuleLoadData@8
|
||||
extern _cuModuleLoadDataEx@20
|
||||
extern _cuModuleUnload@4
|
||||
|
||||
%define _cuMemAlloc@8 _cuMemAlloc_v2@8
|
||||
extern _cuMemAlloc@8
|
||||
%define _cuMemcpyHtoD@12 _cuMemcpyHtoD_v2@12
|
||||
extern _cuMemcpyHtoD@12
|
||||
%define _cuMemcpyDtoH@12 _cuMemcpyDtoH_v2@12
|
||||
extern _cuMemcpyDtoH@12
|
||||
%define _cuMemFree@4 _cuMemFree_v2@4
|
||||
extern _cuMemFree@4
|
||||
|
||||
extern _cuLaunchKernel@44
|
||||
|
||||
extern _cuSurfRefGetArray@8
|
||||
extern _cuSurfRefSetArray@12
|
||||
|
||||
extern _cuGraphicsGLRegisterBuffer@12
|
||||
extern _cuGraphicsGLRegisterImage@16
|
||||
|
||||
extern _cuGraphicsMapResources@12
|
||||
extern _cuGraphicsResourceGetMappedMipmappedArray@8
|
||||
%define _cuGraphicsResourceGetMappedPointer@12 _cuGraphicsResourceGetMappedPointer_v2@12
|
||||
extern _cuGraphicsResourceGetMappedPointer@12
|
||||
extern _cuGraphicsResourceSetMapFlags@8
|
||||
extern _cuGraphicsSubResourceGetMappedArray@16
|
||||
extern _cuGraphicsUnmapResources@12
|
||||
extern _cuGraphicsUnregisterResource@4
|
||||
|
||||
%define CUDA_SUCCESS 0
|
||||
%define CUDA_ERROR_INVALID_VALUE 1
|
||||
%define CUDA_ERROR_OUT_OF_MEMORY 2
|
||||
%define CUDA_ERROR_NOT_INITIALIZED 3
|
||||
%define CUDA_ERROR_DEINITIALIZED 4
|
||||
%define CUDA_ERROR_PROFILER_DISABLED 5
|
||||
%define CUDA_ERROR_PROFILER_NOT_INITIALIZED 6
|
||||
%define CUDA_ERROR_PROFILER_ALREADY_STARTED 7
|
||||
%define CUDA_ERROR_PROFILER_ALREADY_STOPPED 8
|
||||
%define CUDA_ERROR_NO_DEVICE 100
|
||||
%define CUDA_ERROR_INVALID_DEVICE 101
|
||||
%define CUDA_ERROR_INVALID_IMAGE 200
|
||||
%define CUDA_ERROR_INVALID_CONTEXT 201
|
||||
%define CUDA_ERROR_CONTEXT_ALREADY_CURRENT 202
|
||||
%define CUDA_ERROR_MAP_FAILED 205
|
||||
%define CUDA_ERROR_UNMAP_FAILED 206
|
||||
%define CUDA_ERROR_ARRAY_IS_MAPPED 207
|
||||
%define CUDA_ERROR_ALREADY_MAPPED 208
|
||||
%define CUDA_ERROR_NO_BINARY_FOR_GPU 209
|
||||
%define CUDA_ERROR_ALREADY_ACQUIRED 210
|
||||
%define CUDA_ERROR_NOT_MAPPED 211
|
||||
%define CUDA_ERROR_NOT_MAPPED_AS_ARRAY 212
|
||||
%define CUDA_ERROR_NOT_MAPPED_AS_POINTER 213
|
||||
%define CUDA_ERROR_ECC_UNCORRECTABLE 214
|
||||
%define CUDA_ERROR_UNSUPPORTED_LIMIT 215
|
||||
%define CUDA_ERROR_CONTEXT_ALREADY_IN_USE 216
|
||||
%define CUDA_ERROR_PEER_ACCESS_UNSUPPORTED 217
|
||||
%define CUDA_ERROR_INVALID_SOURCE 300
|
||||
%define CUDA_ERROR_FILE_NOT_FOUND 301
|
||||
%define CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND 302
|
||||
%define CUDA_ERROR_SHARED_OBJECT_INIT_FAILED 303
|
||||
%define CUDA_ERROR_OPERATING_SYSTEM 304
|
||||
%define CUDA_ERROR_INVALID_HANDLE 400
|
||||
%define CUDA_ERROR_NOT_FOUND 500
|
||||
%define CUDA_ERROR_NOT_READY 600
|
||||
%define CUDA_ERROR_LAUNCH_FAILED 700
|
||||
%define CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES 701
|
||||
%define CUDA_ERROR_LAUNCH_TIMEOUT 702
|
||||
%define CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING 703
|
||||
%define CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED 704
|
||||
%define CUDA_ERROR_PEER_ACCESS_NOT_ENABLED 705
|
||||
%define CUDA_ERROR_PRIMARY_CONTEXT_ACTIVE 708
|
||||
%define CUDA_ERROR_CONTEXT_IS_DESTROYED 709
|
||||
%define CUDA_ERROR_ASSERT 710
|
||||
%define CUDA_ERROR_TOO_MANY_PEERS 711
|
||||
%define CUDA_ERROR_HOST_MEMORY_ALREADY_REGISTERED 712
|
||||
%define CUDA_ERROR_HOST_MEMORY_NOT_REGISTERED 713
|
||||
%define CUDA_ERROR_NOT_PERMITTED 800
|
||||
%define CUDA_ERROR_NOT_SUPPORTED 801
|
||||
%define CUDA_ERROR_UNKNOWN 999
|
||||
|
||||
%define CU_GRAPHICS_REGISTER_FLAGS_NONE 0x00
|
||||
%define CU_GRAPHICS_REGISTER_FLAGS_READ_ONLY 0x01
|
||||
%define CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD 0x02
|
||||
%define CU_GRAPHICS_REGISTER_FLAGS_SURFACE_LDST 0x04
|
||||
%define CU_GRAPHICS_REGISTER_FLAGS_TEXTURE_GATHER 0x08
|
||||
|
||||
%define CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE 0x00
|
||||
%define CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY 0x01
|
||||
%define CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD 0x02
|
||||
|
||||
%define CU_CUBEMAP_FACE_POSITIVE_X 0x00
|
||||
%define CU_CUBEMAP_FACE_NEGATIVE_X 0x01
|
||||
%define CU_CUBEMAP_FACE_POSITIVE_Y 0x02
|
||||
%define CU_CUBEMAP_FACE_NEGATIVE_Y 0x03
|
||||
%define CU_CUBEMAP_FACE_POSITIVE_Z 0x04
|
||||
%define CU_CUBEMAP_FACE_NEGATIVE_Z 0x05
|
||||
|
||||
2333
hgplus/las/framework-dx11-nasm/inc/d3d11.inc
Normal file
2333
hgplus/las/framework-dx11-nasm/inc/d3d11.inc
Normal file
File diff suppressed because it is too large
Load Diff
2
hgplus/las/framework-dx11-nasm/inc/d3dx11.inc
Normal file
2
hgplus/las/framework-dx11-nasm/inc/d3dx11.inc
Normal file
@@ -0,0 +1,2 @@
|
||||
; d3dx11.inc - las/mercury
|
||||
|
||||
457
hgplus/las/framework-dx11-nasm/inc/dxgi.inc
Normal file
457
hgplus/las/framework-dx11-nasm/inc/dxgi.inc
Normal file
@@ -0,0 +1,457 @@
|
||||
; dxgi.inc by las/mercury
|
||||
|
||||
struc DXGI_SWAP_CHAIN_DESC
|
||||
; DXGI_MODE_DESC BufferDesc
|
||||
.Width: resd 1
|
||||
.Height: resd 1
|
||||
|
||||
; DXGI_RATIONAL RefreshRate
|
||||
.Numerator: resd 1
|
||||
.Denominator: resd 1
|
||||
|
||||
.Format: resd 1
|
||||
.ScanlineOrdering: resd 1
|
||||
.Scaling: resd 1
|
||||
|
||||
; DXGI_SAMPLE_DESC SampleDesc
|
||||
.Count: resd 1
|
||||
.Quality: resd 1
|
||||
|
||||
.BufferUsage: resd 1
|
||||
.BufferCount: resd 1
|
||||
.OutputWindow: resd 1
|
||||
.Windowed: resd 1
|
||||
.SwapEffect: resd 1
|
||||
.Flags: resd 1
|
||||
endstruc
|
||||
|
||||
; DXGI_RESIDENCY
|
||||
%define DXGI_RESIDENCY_FULLY_RESIDENT 1
|
||||
%define DXGI_RESIDENCY_RESIDENT_IN_SHARED_MEMORY 2
|
||||
%define DXGI_RESIDENCY_EVICTED_TO_DISK 3
|
||||
|
||||
; DXGI_SWAP_EFFECT
|
||||
%define DXGI_SWAP_EFFECT_DISCARD 0
|
||||
%define DXGI_SWAP_EFFECT_SEQUENTIAL 1
|
||||
%define DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL 3
|
||||
|
||||
; DXGI_SWAP_CHAIN_FLAG
|
||||
%define DXGI_SWAP_CHAIN_FLAG_NONPREROTATED 1
|
||||
%define DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH 2
|
||||
%define DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE 4
|
||||
%define DXGI_SWAP_CHAIN_FLAG_RESTRICTED_CONTENT 8
|
||||
%define DXGI_SWAP_CHAIN_FLAG_RESTRICT_SHARED_RESOURCE_DRIVER 16
|
||||
%define DXGI_SWAP_CHAIN_FLAG_DISPLAY_ONLY 32
|
||||
%define DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT 64
|
||||
%define DXGI_SWAP_CHAIN_FLAG_FOREGROUND_LAYER 128
|
||||
%define DXGI_SWAP_CHAIN_FLAG_FULLSCREEN_VIDEO 256
|
||||
|
||||
; DXGI_ADAPTER_FLAG
|
||||
%define DXGI_ADAPTER_FLAG_NONE 0
|
||||
%define DXGI_ADAPTER_FLAG_REMOTE 1
|
||||
%define DXGI_ADAPTER_FLAG_SOFTWARE 2
|
||||
%define DXGI_ADAPTER_FLAG_FORCE_DWORD 0xffffffff
|
||||
|
||||
; DXGI_FORMAT
|
||||
%define DXGI_FORMAT_UNKNOWN 0
|
||||
%define DXGI_FORMAT_R32G32B32A32_TYPELESS 1
|
||||
%define DXGI_FORMAT_R32G32B32A32_FLOAT 2
|
||||
%define DXGI_FORMAT_R32G32B32A32_UINT 3
|
||||
%define DXGI_FORMAT_R32G32B32A32_SINT 4
|
||||
%define DXGI_FORMAT_R32G32B32_TYPELESS 5
|
||||
%define DXGI_FORMAT_R32G32B32_FLOAT 6
|
||||
%define DXGI_FORMAT_R32G32B32_UINT 7
|
||||
%define DXGI_FORMAT_R32G32B32_SINT 8
|
||||
%define DXGI_FORMAT_R16G16B16A16_TYPELESS 9
|
||||
%define DXGI_FORMAT_R16G16B16A16_FLOAT 10
|
||||
%define DXGI_FORMAT_R16G16B16A16_UNORM 11
|
||||
%define DXGI_FORMAT_R16G16B16A16_UINT 12
|
||||
%define DXGI_FORMAT_R16G16B16A16_SNORM 13
|
||||
%define DXGI_FORMAT_R16G16B16A16_SINT 14
|
||||
%define DXGI_FORMAT_R32G32_TYPELESS 15
|
||||
%define DXGI_FORMAT_R32G32_FLOAT 16
|
||||
%define DXGI_FORMAT_R32G32_UINT 17
|
||||
%define DXGI_FORMAT_R32G32_SINT 18
|
||||
%define DXGI_FORMAT_R32G8X24_TYPELESS 19
|
||||
%define DXGI_FORMAT_D32_FLOAT_S8X24_UINT 20
|
||||
%define DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS 21
|
||||
%define DXGI_FORMAT_X32_TYPELESS_G8X24_UINT 22
|
||||
%define DXGI_FORMAT_R10G10B10A2_TYPELESS 23
|
||||
%define DXGI_FORMAT_R10G10B10A2_UNORM 24
|
||||
%define DXGI_FORMAT_R10G10B10A2_UINT 25
|
||||
%define DXGI_FORMAT_R11G11B10_FLOAT 26
|
||||
%define DXGI_FORMAT_R8G8B8A8_TYPELESS 27
|
||||
%define DXGI_FORMAT_R8G8B8A8_UNORM 28
|
||||
%define DXGI_FORMAT_R8G8B8A8_UNORM_SRGB 29
|
||||
%define DXGI_FORMAT_R8G8B8A8_UINT 30
|
||||
%define DXGI_FORMAT_R8G8B8A8_SNORM 31
|
||||
%define DXGI_FORMAT_R8G8B8A8_SINT 32
|
||||
%define DXGI_FORMAT_R16G16_TYPELESS 33
|
||||
%define DXGI_FORMAT_R16G16_FLOAT 34
|
||||
%define DXGI_FORMAT_R16G16_UNORM 35
|
||||
%define DXGI_FORMAT_R16G16_UINT 36
|
||||
%define DXGI_FORMAT_R16G16_SNORM 37
|
||||
%define DXGI_FORMAT_R16G16_SINT 38
|
||||
%define DXGI_FORMAT_R32_TYPELESS 39
|
||||
%define DXGI_FORMAT_D32_FLOAT 40
|
||||
%define DXGI_FORMAT_R32_FLOAT 41
|
||||
%define DXGI_FORMAT_R32_UINT 42
|
||||
%define DXGI_FORMAT_R32_SINT 43
|
||||
%define DXGI_FORMAT_R24G8_TYPELESS 44
|
||||
%define DXGI_FORMAT_D24_UNORM_S8_UINT 45
|
||||
%define DXGI_FORMAT_R24_UNORM_X8_TYPELESS 46
|
||||
%define DXGI_FORMAT_X24_TYPELESS_G8_UINT 47
|
||||
%define DXGI_FORMAT_R8G8_TYPELESS 48
|
||||
%define DXGI_FORMAT_R8G8_UNORM 49
|
||||
%define DXGI_FORMAT_R8G8_UINT 50
|
||||
%define DXGI_FORMAT_R8G8_SNORM 51
|
||||
%define DXGI_FORMAT_R8G8_SINT 52
|
||||
%define DXGI_FORMAT_R16_TYPELESS 53
|
||||
%define DXGI_FORMAT_R16_FLOAT 54
|
||||
%define DXGI_FORMAT_D16_UNORM 55
|
||||
%define DXGI_FORMAT_R16_UNORM 56
|
||||
%define DXGI_FORMAT_R16_UINT 57
|
||||
%define DXGI_FORMAT_R16_SNORM 58
|
||||
%define DXGI_FORMAT_R16_SINT 59
|
||||
%define DXGI_FORMAT_R8_TYPELESS 60
|
||||
%define DXGI_FORMAT_R8_UNORM 61
|
||||
%define DXGI_FORMAT_R8_UINT 62
|
||||
%define DXGI_FORMAT_R8_SNORM 63
|
||||
%define DXGI_FORMAT_R8_SINT 64
|
||||
%define DXGI_FORMAT_A8_UNORM 65
|
||||
%define DXGI_FORMAT_R1_UNORM 66
|
||||
%define DXGI_FORMAT_R9G9B9E5_SHAREDEXP 67
|
||||
%define DXGI_FORMAT_R8G8_B8G8_UNORM 68
|
||||
%define DXGI_FORMAT_G8R8_G8B8_UNORM 69
|
||||
%define DXGI_FORMAT_BC1_TYPELESS 70
|
||||
%define DXGI_FORMAT_BC1_UNORM 71
|
||||
%define DXGI_FORMAT_BC1_UNORM_SRGB 72
|
||||
%define DXGI_FORMAT_BC2_TYPELESS 73
|
||||
%define DXGI_FORMAT_BC2_UNORM 74
|
||||
%define DXGI_FORMAT_BC2_UNORM_SRGB 75
|
||||
%define DXGI_FORMAT_BC3_TYPELESS 76
|
||||
%define DXGI_FORMAT_BC3_UNORM 77
|
||||
%define DXGI_FORMAT_BC3_UNORM_SRGB 78
|
||||
%define DXGI_FORMAT_BC4_TYPELESS 79
|
||||
%define DXGI_FORMAT_BC4_UNORM 80
|
||||
%define DXGI_FORMAT_BC4_SNORM 81
|
||||
%define DXGI_FORMAT_BC5_TYPELESS 82
|
||||
%define DXGI_FORMAT_BC5_UNORM 83
|
||||
%define DXGI_FORMAT_BC5_SNORM 84
|
||||
%define DXGI_FORMAT_B5G6R5_UNORM 85
|
||||
%define DXGI_FORMAT_B5G5R5A1_UNORM 86
|
||||
%define DXGI_FORMAT_B8G8R8A8_UNORM 87
|
||||
%define DXGI_FORMAT_B8G8R8X8_UNORM 88
|
||||
%define DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM 89
|
||||
%define DXGI_FORMAT_B8G8R8A8_TYPELESS 90
|
||||
%define DXGI_FORMAT_B8G8R8A8_UNORM_SRGB 91
|
||||
%define DXGI_FORMAT_B8G8R8X8_TYPELESS 92
|
||||
%define DXGI_FORMAT_B8G8R8X8_UNORM_SRGB 93
|
||||
%define DXGI_FORMAT_BC6H_TYPELESS 94
|
||||
%define DXGI_FORMAT_BC6H_UF16 95
|
||||
%define DXGI_FORMAT_BC6H_SF16 96
|
||||
%define DXGI_FORMAT_BC7_TYPELESS 97
|
||||
%define DXGI_FORMAT_BC7_UNORM 98
|
||||
%define DXGI_FORMAT_BC7_UNORM_SRGB 99
|
||||
%define DXGI_FORMAT_AYUV 100
|
||||
%define DXGI_FORMAT_Y410 101
|
||||
%define DXGI_FORMAT_Y416 102
|
||||
%define DXGI_FORMAT_NV12 103
|
||||
%define DXGI_FORMAT_P010 104
|
||||
%define DXGI_FORMAT_P016 105
|
||||
%define DXGI_FORMAT_420_OPAQUE 106
|
||||
%define DXGI_FORMAT_YUY2 107
|
||||
%define DXGI_FORMAT_Y210 108
|
||||
%define DXGI_FORMAT_Y216 109
|
||||
%define DXGI_FORMAT_NV11 110
|
||||
%define DXGI_FORMAT_AI44 111
|
||||
%define DXGI_FORMAT_IA44 112
|
||||
%define DXGI_FORMAT_P8 113
|
||||
%define DXGI_FORMAT_A8P8 114
|
||||
%define DXGI_FORMAT_B4G4R4A4_UNORM 115
|
||||
%define DXGI_FORMAT_FORCE_UINT 0xffffffff
|
||||
|
||||
; DXGI_MODE_SCANLINE_ORDER
|
||||
%define DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED 0
|
||||
%define DXGI_MODE_SCANLINE_ORDER_PROGRESSIVE 1
|
||||
%define DXGI_MODE_SCANLINE_ORDER_UPPER_FIELD_FIRST 2
|
||||
%define DXGI_MODE_SCANLINE_ORDER_LOWER_FIELD_FIRST 3
|
||||
|
||||
; DXGI_MODE_SCALING
|
||||
%define DXGI_MODE_SCALING_UNSPECIFIED 0
|
||||
%define DXGI_MODE_SCALING_CENTERED 1
|
||||
%define DXGI_MODE_SCALING_STRETCHED 2
|
||||
|
||||
; DXGI_MODE_ROTATION
|
||||
%define DXGI_MODE_ROTATION_UNSPECIFIED 0
|
||||
%define DXGI_MODE_ROTATION_IDENTITY 1
|
||||
%define DXGI_MODE_ROTATION_ROTATE90 2
|
||||
%define DXGI_MODE_ROTATION_ROTATE180 3
|
||||
%define DXGI_MODE_ROTATION_ROTATE270 4
|
||||
|
||||
|
||||
%define DXGI_CPU_ACCESS_NONE (0)
|
||||
%define DXGI_CPU_ACCESS_DYNAMIC (1)
|
||||
%define DXGI_CPU_ACCESS_READ_WRITE (2)
|
||||
%define DXGI_CPU_ACCESS_SCRATCH (3)
|
||||
%define DXGI_CPU_ACCESS_FIELD 15
|
||||
%define DXGI_USAGE_SHADER_INPUT (1<<(0 + 4))
|
||||
%define DXGI_USAGE_RENDER_TARGET_OUTPUT (1<<(1 + 4))
|
||||
%define DXGI_USAGE_BACK_BUFFER (1<<(2 + 4))
|
||||
%define DXGI_USAGE_SHARED (1<<(3 + 4))
|
||||
%define DXGI_USAGE_READ_ONLY (1<<(4 + 4))
|
||||
%define DXGI_USAGE_DISCARD_ON_PRESENT (1<<(5 + 4))
|
||||
%define DXGI_USAGE_UNORDERED_ACCESS (1<<(6 + 4))
|
||||
%define DXGI_RESOURCE_PRIORITY_MINIMUM (0x28000000)
|
||||
%define DXGI_RESOURCE_PRIORITY_LOW (0x50000000)
|
||||
%define DXGI_RESOURCE_PRIORITY_NORMAL (0x78000000)
|
||||
%define DXGI_RESOURCE_PRIORITY_HIGH (0xa0000000)
|
||||
%define DXGI_RESOURCE_PRIORITY_MAXIMUM (0xc8000000)
|
||||
%define DXGI_MAP_READ (1)
|
||||
%define DXGI_MAP_WRITE (2)
|
||||
%define DXGI_MAP_DISCARD (4)
|
||||
%define DXGI_ENUM_MODES_INTERLACED (1)
|
||||
%define DXGI_ENUM_MODES_SCALING (2)
|
||||
%define DXGI_MAX_SWAP_CHAIN_BUFFERS (16)
|
||||
%define DXGI_PRESENT_TEST 0x00000001
|
||||
%define DXGI_PRESENT_DO_NOT_SEQUENCE 0x00000002
|
||||
%define DXGI_PRESENT_RESTART 0x00000004
|
||||
%define DXGI_PRESENT_DO_NOT_WAIT 0x00000008
|
||||
%define DXGI_PRESENT_STEREO_PREFER_RIGHT 0x00000010
|
||||
%define DXGI_PRESENT_STEREO_TEMPORARY_MONO 0x00000020
|
||||
%define DXGI_PRESENT_RESTRICT_TO_OUTPUT 0x00000040
|
||||
%define DXGI_PRESENT_USE_DURATION 0x00000100
|
||||
%define DXGI_MWA_NO_WINDOW_CHANGES (1<<0)
|
||||
%define DXGI_MWA_NO_ALT_ENTER (1<<1)
|
||||
%define DXGI_MWA_NO_PRINT_SCREEN (1<<2)
|
||||
%define DXGI_MWA_VALID (0x7)
|
||||
%define DXGI_FORMAT_DEFINED 1
|
||||
%define _FACDXGI 0x87a
|
||||
%define MAKE_DXGI_HRESULT(code) MAKE_HRESULT(1, _FACDXGI, code)
|
||||
%define MAKE_DXGI_STATUS(code) MAKE_HRESULT(0, _FACDXGI, code)
|
||||
%define DXGI_CPU_ACCESS_NONE (0)
|
||||
%define DXGI_CPU_ACCESS_DYNAMIC (1)
|
||||
%define DXGI_CPU_ACCESS_READ_WRITE (2)
|
||||
%define DXGI_CPU_ACCESS_SCRATCH (3)
|
||||
%define DXGI_CPU_ACCESS_FIELD 15
|
||||
%define DXGI_USAGE_SHADER_INPUT (1<<(0 + 4))
|
||||
%define DXGI_USAGE_RENDER_TARGET_OUTPUT (1<<(1 + 4))
|
||||
%define DXGI_USAGE_BACK_BUFFER (1<<(2 + 4))
|
||||
%define DXGI_USAGE_SHARED (1<<(3 + 4))
|
||||
%define DXGI_USAGE_READ_ONLY (1<<(4 + 4))
|
||||
%define DXGI_USAGE_DISCARD_ON_PRESENT (1<<(5 + 4))
|
||||
%define DXGI_USAGE_UNORDERED_ACCESS (1<<(6 + 4))
|
||||
|
||||
|
||||
struc IDXGIObject
|
||||
.QueryInterface: resb 4
|
||||
.AddRef: resb 4
|
||||
.Release: resb 4
|
||||
.SetPrivateData: resb 4
|
||||
.SetPrivateDataInterface: resb 4
|
||||
.GetPrivateData: resb 4
|
||||
.GetParent: resb 4
|
||||
endstruc
|
||||
|
||||
struc IDXGIDeviceSubObject
|
||||
.QueryInterface: resb 4
|
||||
.AddRef: resb 4
|
||||
.Release: resb 4
|
||||
.SetPrivateData: resb 4
|
||||
.SetPrivateDataInterface: resb 4
|
||||
.GetPrivateData: resb 4
|
||||
.GetParent: resb 4
|
||||
.GetDevice: resb 4
|
||||
endstruc
|
||||
|
||||
struc IDXGIResource
|
||||
.QueryInterface: resb 4
|
||||
.AddRef: resb 4
|
||||
.Release: resb 4
|
||||
.SetPrivateData: resb 4
|
||||
.SetPrivateDataInterface: resb 4
|
||||
.GetPrivateData: resb 4
|
||||
.GetParent: resb 4
|
||||
.GetDevice: resb 4
|
||||
.GetSharedHandle: resb 4
|
||||
.GetUsage: resb 4
|
||||
.SetEvictionPriority: resb 4
|
||||
.GetEvictionPriority: resb 4
|
||||
endstruc
|
||||
|
||||
struc IDXGIKeyedMutex
|
||||
.QueryInterface: resb 4
|
||||
.AddRef: resb 4
|
||||
.Release: resb 4
|
||||
.SetPrivateData: resb 4
|
||||
.SetPrivateDataInterface: resb 4
|
||||
.GetPrivateData: resb 4
|
||||
.GetParent: resb 4
|
||||
.GetDevice: resb 4
|
||||
.AcquireSync: resb 4
|
||||
.ReleaseSync: resb 4
|
||||
endstruc
|
||||
|
||||
struc IDXGISurface
|
||||
.QueryInterface: resb 4
|
||||
.AddRef: resb 4
|
||||
.Release: resb 4
|
||||
.SetPrivateData: resb 4
|
||||
.SetPrivateDataInterface: resb 4
|
||||
.GetPrivateData: resb 4
|
||||
.GetParent: resb 4
|
||||
.GetDevice: resb 4
|
||||
.GetDesc: resb 4
|
||||
.Map: resb 4
|
||||
.Unmap: resb 4
|
||||
endstruc
|
||||
|
||||
struc IDXGISurface1
|
||||
.QueryInterface: resb 4
|
||||
.AddRef: resb 4
|
||||
.Release: resb 4
|
||||
.SetPrivateData: resb 4
|
||||
.SetPrivateDataInterface: resb 4
|
||||
.GetPrivateData: resb 4
|
||||
.GetParent: resb 4
|
||||
.GetDevice: resb 4
|
||||
.GetDesc: resb 4
|
||||
.Map: resb 4
|
||||
.Unmap: resb 4
|
||||
.GetDC: resb 4
|
||||
.ReleaseDC: resb 4
|
||||
endstruc
|
||||
|
||||
struc IDXGIAdapter
|
||||
.QueryInterface: resb 4
|
||||
.AddRef: resb 4
|
||||
.Release: resb 4
|
||||
.SetPrivateData: resb 4
|
||||
.SetPrivateDataInterface: resb 4
|
||||
.GetPrivateData: resb 4
|
||||
.GetParent: resb 4
|
||||
.EnumOutputs: resb 4
|
||||
.GetDesc: resb 4
|
||||
.CheckInterfaceSupport: resb 4
|
||||
endstruc
|
||||
|
||||
struc IDXGIOutput
|
||||
.QueryInterface: resb 4
|
||||
.AddRef: resb 4
|
||||
.Release: resb 4
|
||||
.SetPrivateData: resb 4
|
||||
.SetPrivateDataInterface: resb 4
|
||||
.GetPrivateData: resb 4
|
||||
.GetParent: resb 4
|
||||
.GetDesc: resb 4
|
||||
.GetDisplayModeList: resb 4
|
||||
.FindClosestMatchingMode: resb 4
|
||||
.WaitForVBlank: resb 4
|
||||
.TakeOwnership: resb 4
|
||||
.ReleaseOwnership: resb 4
|
||||
.GetGammaControlCapabilities: resb 4
|
||||
.SetGammaControl: resb 4
|
||||
.GetGammaControl: resb 4
|
||||
.SetDisplaySurface: resb 4
|
||||
.GetDisplaySurfaceData: resb 4
|
||||
.GetFrameStatistics: resb 4
|
||||
endstruc
|
||||
|
||||
struc IDXGISwapChain
|
||||
.QueryInterface: resb 4
|
||||
.AddRef: resb 4
|
||||
.Release: resb 4
|
||||
.SetPrivateData: resb 4
|
||||
.SetPrivateDataInterface: resb 4
|
||||
.GetPrivateData: resb 4
|
||||
.GetParent: resb 4
|
||||
.GetDevice: resb 4
|
||||
.Present: resb 4
|
||||
.GetBuffer: resb 4
|
||||
.SetFullscreenState: resb 4
|
||||
.GetFullscreenState: resb 4
|
||||
.GetDesc: resb 4
|
||||
.ResizeBuffers: resb 4
|
||||
.ResizeTarget: resb 4
|
||||
.GetContainingOutput: resb 4
|
||||
.GetFrameStatistics: resb 4
|
||||
.GetLastPresentCount: resb 4
|
||||
endstruc
|
||||
|
||||
struc IDXGIFactory
|
||||
.QueryInterface: resb 4
|
||||
.AddRef: resb 4
|
||||
.Release: resb 4
|
||||
.SetPrivateData: resb 4
|
||||
.SetPrivateDataInterface: resb 4
|
||||
.GetPrivateData: resb 4
|
||||
.GetParent: resb 4
|
||||
.EnumAdapters: resb 4
|
||||
.MakeWindowAssociation: resb 4
|
||||
.GetWindowAssociation: resb 4
|
||||
.CreateSwapChain: resb 4
|
||||
.CreateSoftwareAdapter: resb 4
|
||||
endstruc
|
||||
|
||||
struc IDXGIDevice
|
||||
.QueryInterface: resb 4
|
||||
.AddRef: resb 4
|
||||
.Release: resb 4
|
||||
.SetPrivateData: resb 4
|
||||
.SetPrivateDataInterface: resb 4
|
||||
.GetPrivateData: resb 4
|
||||
.GetParent: resb 4
|
||||
.GetAdapter: resb 4
|
||||
.CreateSurface: resb 4
|
||||
.QueryResourceResidency: resb 4
|
||||
.SetGPUThreadPriority: resb 4
|
||||
.GetGPUThreadPriority: resb 4
|
||||
endstruc
|
||||
|
||||
struc IDXGIFactory1
|
||||
.QueryInterface: resb 4
|
||||
.AddRef: resb 4
|
||||
.Release: resb 4
|
||||
.SetPrivateData: resb 4
|
||||
.SetPrivateDataInterface: resb 4
|
||||
.GetPrivateData: resb 4
|
||||
.GetParent: resb 4
|
||||
.EnumAdapters: resb 4
|
||||
.MakeWindowAssociation: resb 4
|
||||
.GetWindowAssociation: resb 4
|
||||
.CreateSwapChain: resb 4
|
||||
.CreateSoftwareAdapter: resb 4
|
||||
.EnumAdapters1: resb 4
|
||||
.IsCurrent: resb 4
|
||||
endstruc
|
||||
|
||||
struc IDXGIAdapter1
|
||||
.QueryInterface: resb 4
|
||||
.AddRef: resb 4
|
||||
.Release: resb 4
|
||||
.SetPrivateData: resb 4
|
||||
.SetPrivateDataInterface: resb 4
|
||||
.GetPrivateData: resb 4
|
||||
.GetParent: resb 4
|
||||
.EnumOutputs: resb 4
|
||||
.GetDesc: resb 4
|
||||
.CheckInterfaceSupport: resb 4
|
||||
.GetDesc1: resb 4
|
||||
endstruc
|
||||
|
||||
struc IDXGIDevice1
|
||||
.QueryInterface: resb 4
|
||||
.AddRef: resb 4
|
||||
.Release: resb 4
|
||||
.SetPrivateData: resb 4
|
||||
.SetPrivateDataInterface: resb 4
|
||||
.GetPrivateData: resb 4
|
||||
.GetParent: resb 4
|
||||
.GetAdapter: resb 4
|
||||
.CreateSurface: resb 4
|
||||
.QueryResourceResidency: resb 4
|
||||
.SetGPUThreadPriority: resb 4
|
||||
.GetGPUThreadPriority: resb 4
|
||||
.SetMaximumFrameLatency: resb 4
|
||||
.GetMaximumFrameLatency: resb 4
|
||||
endstruc
|
||||
366
hgplus/las/framework-dx11-nasm/inc/font.inc
Normal file
366
hgplus/las/framework-dx11-nasm/inc/font.inc
Normal file
@@ -0,0 +1,366 @@
|
||||
; font.inc - las/mercury
|
||||
|
||||
; numbers 0-9
|
||||
_0:
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11011011b)
|
||||
db REVERSEBITS(11011011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
|
||||
_1:
|
||||
db REVERSEBITS(01111000b)
|
||||
db REVERSEBITS(01111000b)
|
||||
db REVERSEBITS(00011000b)
|
||||
db REVERSEBITS(00011000b)
|
||||
db REVERSEBITS(00011000b)
|
||||
db REVERSEBITS(00011000b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
|
||||
_2:
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(00000011b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11000000b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
|
||||
_3:
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(00000011b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(00000011b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
|
||||
_4:
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(00000011b)
|
||||
db REVERSEBITS(00000011b)
|
||||
db REVERSEBITS(00000011b)
|
||||
|
||||
_5:
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11000000b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(00000011b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
|
||||
_6:
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11000000b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
|
||||
_7:
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(00000011b)
|
||||
db REVERSEBITS(00000011b)
|
||||
db REVERSEBITS(00000011b)
|
||||
db REVERSEBITS(00000011b)
|
||||
db REVERSEBITS(00000011b)
|
||||
db REVERSEBITS(00000011b)
|
||||
|
||||
_8:
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
|
||||
_9:
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(00000011b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
|
||||
; : ; < = > ? @
|
||||
dq 0, 0, 0, 0, 0, 0, 0
|
||||
|
||||
; letters A-Z
|
||||
_A:
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
|
||||
_B:
|
||||
db REVERSEBITS(11111110b)
|
||||
db REVERSEBITS(11111110b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
|
||||
_C:
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11000000b)
|
||||
db REVERSEBITS(11000000b)
|
||||
db REVERSEBITS(11000000b)
|
||||
db REVERSEBITS(11000000b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
|
||||
_D:
|
||||
db REVERSEBITS(11111100b)
|
||||
db REVERSEBITS(11111100b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
|
||||
_E:
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11000000b)
|
||||
db REVERSEBITS(11111100b)
|
||||
db REVERSEBITS(11111100b)
|
||||
db REVERSEBITS(11000000b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
|
||||
_F:
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11000000b)
|
||||
db REVERSEBITS(11111100b)
|
||||
db REVERSEBITS(11111100b)
|
||||
db REVERSEBITS(11000000b)
|
||||
db REVERSEBITS(11000000b)
|
||||
db REVERSEBITS(11000000b)
|
||||
|
||||
_G:
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11000000b)
|
||||
db REVERSEBITS(11001111b)
|
||||
db REVERSEBITS(11001111b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
|
||||
_H:
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
|
||||
_I:
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(00011000b)
|
||||
db REVERSEBITS(00011000b)
|
||||
db REVERSEBITS(00011000b)
|
||||
db REVERSEBITS(00011000b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
|
||||
_J:
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(00000011b)
|
||||
db REVERSEBITS(00000011b)
|
||||
db REVERSEBITS(00000011b)
|
||||
db REVERSEBITS(00000011b)
|
||||
db REVERSEBITS(11111100b)
|
||||
db REVERSEBITS(11111100b)
|
||||
|
||||
_K:
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11111100b)
|
||||
db REVERSEBITS(11111100b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
|
||||
_L:
|
||||
db REVERSEBITS(11000000b)
|
||||
db REVERSEBITS(11000000b)
|
||||
db REVERSEBITS(11000000b)
|
||||
db REVERSEBITS(11000000b)
|
||||
db REVERSEBITS(11000000b)
|
||||
db REVERSEBITS(11000000b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
|
||||
_M:
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11011011b)
|
||||
db REVERSEBITS(11011011b)
|
||||
db REVERSEBITS(11011011b)
|
||||
db REVERSEBITS(11011011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
|
||||
_N:
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
|
||||
_O:
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
|
||||
_P:
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11000000b)
|
||||
db REVERSEBITS(11000000b)
|
||||
db REVERSEBITS(11000000b)
|
||||
|
||||
_Q:
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11011011b)
|
||||
db REVERSEBITS(11011011b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
|
||||
_R:
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111100b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
|
||||
_S:
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11000000b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(00000011b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
|
||||
_T:
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(00011000b)
|
||||
db REVERSEBITS(00011000b)
|
||||
db REVERSEBITS(00011000b)
|
||||
db REVERSEBITS(00011000b)
|
||||
db REVERSEBITS(00011000b)
|
||||
db REVERSEBITS(00011000b)
|
||||
|
||||
_U:
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
|
||||
_V:
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(00111100b)
|
||||
db REVERSEBITS(00111100b)
|
||||
|
||||
_W:
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11011011b)
|
||||
db REVERSEBITS(11011011b)
|
||||
db REVERSEBITS(11011011b)
|
||||
db REVERSEBITS(11011011b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
|
||||
_X:
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(00111100b)
|
||||
db REVERSEBITS(00111100b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
|
||||
_Y:
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11000011b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(00011000b)
|
||||
db REVERSEBITS(00011000b)
|
||||
db REVERSEBITS(00011000b)
|
||||
|
||||
_Z:
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(00000011b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11000000b)
|
||||
db REVERSEBITS(11111111b)
|
||||
db REVERSEBITS(11111111b)
|
||||
200
hgplus/las/framework-dx11-nasm/inc/macros.inc
Normal file
200
hgplus/las/framework-dx11-nasm/inc/macros.inc
Normal file
@@ -0,0 +1,200 @@
|
||||
; macros.inc - las/mercury
|
||||
|
||||
%macro TEXT_SECTION 1
|
||||
section %1 text align=1
|
||||
%endmacro
|
||||
|
||||
%macro DATA_SECTION 1
|
||||
section %1 data align=1
|
||||
%endmacro
|
||||
|
||||
%macro BSS_SECTION 1
|
||||
section %1 bss align=1
|
||||
%endmacro
|
||||
|
||||
%define REVERSEBITS(b) (\
|
||||
(b & 128) >> 7 |\
|
||||
(b & 64) >> 5 |\
|
||||
(b & 32) >> 3 |\
|
||||
(b & 16) >> 1 |\
|
||||
(b & 8) << 1 |\
|
||||
(b & 4) << 3 |\
|
||||
(b & 2) << 5 |\
|
||||
(b & 1) << 7)
|
||||
|
||||
%macro com 2
|
||||
push dword [%1]
|
||||
push dword [%1]
|
||||
pop eax
|
||||
mov eax, [eax]
|
||||
call [eax + %2]
|
||||
%endmacro
|
||||
|
||||
%macro com 1
|
||||
pop eax
|
||||
mov eax, [eax]
|
||||
call [eax + %2]
|
||||
%endmacro
|
||||
|
||||
%ifdef IBH
|
||||
%macro glext 1
|
||||
call dword [%1]
|
||||
%endmacro
|
||||
%endif
|
||||
|
||||
%ifndef IBH
|
||||
%macro glext 1
|
||||
push dword %1
|
||||
call _wglGetProcAddress@4
|
||||
call eax
|
||||
%endmacro
|
||||
%endif
|
||||
|
||||
%macro DBG 1
|
||||
%ifdef DEBUG
|
||||
%define msg %1
|
||||
%strlen msgLength msg
|
||||
pushad
|
||||
xor eax, eax
|
||||
push eax
|
||||
push eax
|
||||
push dword STD_ERROR_HANDLE
|
||||
call _GetStdHandle@4
|
||||
push dword msgLength+2
|
||||
call %%endOfMsg
|
||||
db msg, 13, 10
|
||||
%%endOfMsg:
|
||||
push eax
|
||||
call _WriteFile@20
|
||||
popad
|
||||
%undef msg
|
||||
%undef msgLength
|
||||
%endif
|
||||
%endmacro
|
||||
|
||||
%macro DBG_BOX 2
|
||||
%ifdef DEBUG
|
||||
%define caption %2
|
||||
%define text %1
|
||||
pushad
|
||||
xor eax, eax
|
||||
push eax
|
||||
call %%endCaption
|
||||
db caption, 0
|
||||
%%endCaption:
|
||||
call %%endText
|
||||
db text, 0
|
||||
%%endText:
|
||||
push eax
|
||||
call _MessageBoxA@16
|
||||
popad
|
||||
%undef msg
|
||||
%endif
|
||||
%endmacro
|
||||
|
||||
%macro DBG_NO_NL 1
|
||||
%ifdef DEBUG
|
||||
%define msg %1
|
||||
%strlen msgLength msg
|
||||
pushad
|
||||
xor eax, eax
|
||||
push eax
|
||||
push eax
|
||||
push dword STD_ERROR_HANDLE
|
||||
call _GetStdHandle@4
|
||||
push dword msgLength
|
||||
call %%endOfMsg
|
||||
db msg
|
||||
%%endOfMsg:
|
||||
push eax
|
||||
call _WriteFile@20
|
||||
popad
|
||||
%undef msg
|
||||
%undef msgLength
|
||||
%endif
|
||||
%endmacro
|
||||
|
||||
%macro DBG_STR 0
|
||||
pop eax
|
||||
pushad
|
||||
xchg eax, edx
|
||||
mov edi, edx
|
||||
xor eax, eax
|
||||
xor ecx, ecx
|
||||
not ecx
|
||||
cld
|
||||
repne scasb
|
||||
not ecx
|
||||
dec ecx
|
||||
|
||||
push eax
|
||||
push eax
|
||||
push ecx
|
||||
push edx
|
||||
|
||||
push dword STD_ERROR_HANDLE
|
||||
call _GetStdHandle@4
|
||||
|
||||
push eax
|
||||
call _WriteFile@20
|
||||
popad
|
||||
%endmacro
|
||||
|
||||
%macro DBG_CHAR 0
|
||||
mov eax, esp
|
||||
pushad
|
||||
mov ebx, eax
|
||||
xor ecx, ecx
|
||||
push ecx
|
||||
push ecx
|
||||
push dword STD_ERROR_HANDLE
|
||||
call _GetStdHandle@4
|
||||
push byte 1
|
||||
push ebx
|
||||
push eax
|
||||
call _WriteFile@20
|
||||
popad
|
||||
pop eax
|
||||
%endmacro
|
||||
|
||||
%macro DBG_NUM 0
|
||||
pop eax
|
||||
pushad
|
||||
xor ebx, ebx
|
||||
%%pushDigitLoop:
|
||||
inc ebx
|
||||
xor edx, edx
|
||||
mov ecx, dword 10
|
||||
div ecx
|
||||
add edx, byte '0'
|
||||
push edx
|
||||
test eax, eax
|
||||
jnz %%pushDigitLoop
|
||||
mov ecx, ebx
|
||||
%%printDigitLoop:
|
||||
DBG_CHAR
|
||||
loop %%printDigitLoop
|
||||
popad
|
||||
%endmacro
|
||||
|
||||
%macro DBG_EXIT_EAX_0 1
|
||||
%ifdef DEBUG
|
||||
test eax, eax
|
||||
jnz short %%isNotZero
|
||||
DBG %1
|
||||
push byte 0
|
||||
call _ExitProcess@4
|
||||
%%isNotZero:
|
||||
%endif
|
||||
%endmacro
|
||||
|
||||
%macro DBG_EXIT_EAX_NOT_0 1
|
||||
%ifdef DEBUG
|
||||
test eax, eax
|
||||
jz short %%isZero
|
||||
DBG %1
|
||||
push byte 0
|
||||
call _ExitProcess@4
|
||||
%%isZero:
|
||||
%endif
|
||||
%endmacro
|
||||
95
hgplus/las/framework-dx11-nasm/inc/opengl.inc
Normal file
95
hgplus/las/framework-dx11-nasm/inc/opengl.inc
Normal file
@@ -0,0 +1,95 @@
|
||||
; opengl.inc - las/mercury
|
||||
|
||||
; opengl32
|
||||
extern _wglCreateContext@4
|
||||
extern _wglGetProcAddress@4
|
||||
extern _wglMakeCurrent@8
|
||||
|
||||
extern _glClearColor@16
|
||||
extern _glClear@4
|
||||
extern _glColor4ubv@4
|
||||
extern _glColor4f@16
|
||||
extern _glRecti@16
|
||||
extern _glRectf@16
|
||||
extern _glGetString@4
|
||||
|
||||
extern _glTexParameteri@12
|
||||
extern _glTexImage2D@36
|
||||
extern _glBindTexture@8
|
||||
extern _glGenTextures@8
|
||||
|
||||
extern _glGetIntegerv@8
|
||||
extern _glViewport@16
|
||||
|
||||
%define GL_COMPUTE_SHADER 0x91b9
|
||||
%define GL_FRAGMENT_SHADER 0x8b30
|
||||
|
||||
%define GL_VERSION 0x1F02
|
||||
|
||||
%define GL_DEPTH_BUFFER_BIT 0x00000100
|
||||
%define GL_COLOR_BUFFER_BIT 0x00004000
|
||||
|
||||
%define GL_FRAMEBUFFER 0x8D40
|
||||
%define GL_FRAMEBUFFER_COMPLETE 0x8CD5
|
||||
|
||||
%define GL_SHADER_STORAGE_BUFFER 0x90D2
|
||||
%define GL_UNIFORM_BUFFER 0x8A11
|
||||
|
||||
%define GL_SHADER_STORAGE_BARRIER_BIT 0x00002000
|
||||
|
||||
%define GL_STREAM_DRAW 0x88E0
|
||||
%define GL_STREAM_READ 0x88E1
|
||||
%define GL_STREAM_COPY 0x88E2
|
||||
%define GL_STATIC_DRAW 0x88E4
|
||||
%define GL_STATIC_READ 0x88E5
|
||||
%define GL_STATIC_COPY 0x88E6
|
||||
%define GL_DYNAMIC_DRAW 0x88E8
|
||||
%define GL_DYNAMIC_READ 0x88E9
|
||||
%define GL_DYNAMIC_COPY 0x88EA
|
||||
|
||||
%define GL_TEXTURE0 0x84C0
|
||||
%define GL_TEXTURE1 (GL_TEXTURE0+1)
|
||||
%define GL_TEXTURE2 (GL_TEXTURE0+2)
|
||||
%define GL_TEXTURE3 (GL_TEXTURE0+3)
|
||||
%define GL_TEXTURE4 (GL_TEXTURE0+4)
|
||||
%define GL_TEXTURE5 (GL_TEXTURE0+5)
|
||||
%define GL_TEXTURE6 (GL_TEXTURE0+6)
|
||||
%define GL_TEXTURE7 (GL_TEXTURE0+7)
|
||||
%define GL_TEXTURE8 (GL_TEXTURE0+8)
|
||||
%define GL_TEXTURE9 (GL_TEXTURE0+9)
|
||||
|
||||
%define GL_TEXTURE_2D 0x0DE1
|
||||
|
||||
%define GL_NEAREST 0x2600
|
||||
%define GL_LINEAR 0x2601
|
||||
%define GL_LINEAR_MIPMAP_LINEAR 0x2703
|
||||
|
||||
%define GL_TEXTURE_MAG_FILTER 0x2800
|
||||
%define GL_TEXTURE_MIN_FILTER 0x2801
|
||||
|
||||
%define GL_CLAMP_TO_EDGE 0x812F
|
||||
%define GL_CLAMP 0x2900
|
||||
%define GL_REPEAT 0x2901
|
||||
|
||||
%define GL_TEXTURE_WRAP_R 0x8072
|
||||
%define GL_TEXTURE_WRAP_S 0x2802
|
||||
%define GL_TEXTURE_WRAP_T 0x2803
|
||||
|
||||
%define GL_BYTE 0x1400
|
||||
%define GL_UNSIGNED_BYTE 0x1401
|
||||
%define GL_SHORT 0x1402
|
||||
%define GL_UNSIGNED_SHORT 0x1403
|
||||
%define GL_INT 0x1404
|
||||
%define GL_UNSIGNED_INT 0x1405
|
||||
%define GL_FLOAT 0x1406
|
||||
%define GL_HALF_FLOAT 0x140B
|
||||
|
||||
%define GL_RGBA 0x1908
|
||||
|
||||
%define GL_RGBA32F 0x8814
|
||||
%define GL_RGB32F 0x8815
|
||||
%define GL_RGBA16F 0x881A
|
||||
%define GL_RGB16F 0x881B
|
||||
|
||||
%define GL_VIEWPORT 0x0BA2
|
||||
%define GL_COLOR_ATTACHMENT0 0x8CE0
|
||||
336
hgplus/las/framework-dx11-nasm/inc/windows.inc
Normal file
336
hgplus/las/framework-dx11-nasm/inc/windows.inc
Normal file
@@ -0,0 +1,336 @@
|
||||
; windows.inc - las/mercury
|
||||
|
||||
; ntdll
|
||||
extern _LdrShutdownProcess@0
|
||||
|
||||
; kernel32
|
||||
extern _GetTickCount@0
|
||||
extern _ExitProcess@4
|
||||
extern _Sleep@4
|
||||
extern _OpenFile@12
|
||||
extern __lread@12
|
||||
extern _K32EnumProcessModules@16
|
||||
extern _GetCurrentProcess@0
|
||||
extern _OutputDebugStringA@4
|
||||
extern _GetStdHandle@4
|
||||
extern _WriteFile@20
|
||||
extern _CreateThread@24
|
||||
|
||||
; user32
|
||||
extern _ChangeDisplaySettingsA@8
|
||||
extern _CreateWindowExA@48
|
||||
extern _GetAsyncKeyState@4
|
||||
extern _GetDC@4
|
||||
extern _ShowCursor@4
|
||||
extern _SetCursor@4
|
||||
extern _SetCursorPos@8
|
||||
extern _PeekMessageA@20
|
||||
extern _PeekMessageW@20
|
||||
extern _TranslateMessage@4
|
||||
extern _DispatchMessageA@4
|
||||
extern _MessageBoxA@16
|
||||
|
||||
; gdi32
|
||||
extern _ChoosePixelFormat@8
|
||||
extern _SetPixelFormat@12
|
||||
extern _SwapBuffers@4
|
||||
|
||||
; winmm
|
||||
extern _waveOutOpen@24
|
||||
extern _waveOutPrepareHeader@12
|
||||
extern _waveOutWrite@12
|
||||
extern _waveOutGetPosition@12
|
||||
|
||||
%define ATOM_DIALOG 0x8002
|
||||
%define ATOM_BUTTON 0xC017
|
||||
%define ATOM_EDIT 0xC018
|
||||
%define ATOM_STATIC 0xC019
|
||||
%define ATOM_LISTBOX 0xC01A
|
||||
%define ATOM_SCROLLBAR 0xC01B
|
||||
%define ATOM_COMBOBOX 0xC01C
|
||||
|
||||
struc WAVEFORMATEX
|
||||
.wFormatTag resw 1
|
||||
.nChannels resw 1
|
||||
.nSamplesPerSec resd 1
|
||||
.nAvgBytesPerSec resd 1
|
||||
.nBlockAlign resw 1
|
||||
.wBitsPerSample resw 1
|
||||
.cbSize resw 1
|
||||
endstruc
|
||||
|
||||
struc WAVEHDR
|
||||
.lpData resd 1
|
||||
.dwBufferLength resd 1
|
||||
.dwBytesRecorded resd 1
|
||||
.dwUser resd 1
|
||||
.dwFlags resd 1
|
||||
.dwLoops resd 1
|
||||
.lpNext resd 1
|
||||
.reserved resd 1
|
||||
endstruc
|
||||
|
||||
struc MMTIME
|
||||
.wType resd 1
|
||||
.data resd 1
|
||||
.padding resd 1
|
||||
endstruc
|
||||
|
||||
%define TIME_MS 1
|
||||
%define TIME_SAMPLES 2
|
||||
%define TIME_BYTES 4
|
||||
%define TIME_SMPTE 8
|
||||
%define TIME_MIDI 16
|
||||
%define TIME_TICKS 32
|
||||
|
||||
%define WAVE_MAPPER -1
|
||||
%define WAVE_FORMAT_PCM 1
|
||||
%define WAVE_FORMAT_IEEE_FLOAT 3
|
||||
|
||||
%define WHDR_DONE 0x00000001
|
||||
%define WHDR_PREPARED 0x00000002
|
||||
%define WHDR_BEGINLOOP 0x00000004
|
||||
%define WHDR_ENDLOOP 0x00000008
|
||||
%define WHDR_INQUEUE 0x00000010
|
||||
|
||||
%define WAVERR_BASE (0x20)
|
||||
%define WAVERR_BADFORMAT (WAVERR_BASE+0)
|
||||
%define WAVERR_STILLPLAYING (WAVERR_BASE+1)
|
||||
%define WAVERR_UNPREPARED (WAVERR_BASE+2)
|
||||
%define WAVERR_SYNC (WAVERR_BASE+3)
|
||||
%define WAVERR_LASTERROR (WAVERR_BASE+3)
|
||||
|
||||
struc CONTEXT
|
||||
.ContextFlags resd 1
|
||||
._dr0 resd 1
|
||||
._dr1 resd 1
|
||||
._dr2 resd 1
|
||||
._dr3 resd 1
|
||||
._dr6 resd 1
|
||||
._dr7 resd 1
|
||||
.FloatSave resb 32+80
|
||||
._gs resd 1
|
||||
._fs resd 1
|
||||
._es resd 1
|
||||
._ds resd 1
|
||||
._edi resd 1
|
||||
._esi resd 1
|
||||
._ebx resd 1
|
||||
._edx resd 1
|
||||
._ecx resd 1
|
||||
._eax resd 1
|
||||
._ebp resd 1
|
||||
._eip resd 1
|
||||
._cs resd 1
|
||||
._eflags resd 1
|
||||
._esp resd 1
|
||||
._ss resd 1
|
||||
.ExtendedRegisters resb 512
|
||||
endstruc
|
||||
|
||||
struc EXCEPTION_POINTERS
|
||||
.pExceptionRecord resd 1
|
||||
.pContextRecord resd 1
|
||||
endstruc
|
||||
|
||||
struc MSG
|
||||
.hwnd: resd 1
|
||||
.msg: resd 1
|
||||
.wParam: resd 1
|
||||
.lParam: resd 1
|
||||
.time: resd 1
|
||||
.pt: resd 2
|
||||
endstruc
|
||||
|
||||
%define OF_READ 0x00000000
|
||||
|
||||
%define DM_BITSPERPEL 0x00040000
|
||||
%define DM_PELSWIDTH 0x00080000
|
||||
%define DM_PELSHEIGHT 0x00100000
|
||||
%define CDS_FULLSCREEN 0x00000004
|
||||
%define PFD_SUPPORT_OPENGL 0x00000020
|
||||
%define PFD_DOUBLEBUFFER 0x00000001
|
||||
%define PFD_DRAW_TO_WINDOW 0x00000004
|
||||
%define PFD_MAIN_PLANE 0x00000000
|
||||
%define PFD_TYPE_RGBA 0x00000000
|
||||
|
||||
%define WM_QUIT 0x0012
|
||||
%define WM_KEYDOWN 0x0100
|
||||
%define WM_CHAR 0x0102
|
||||
%define PM_NOREMOVE 0x0000
|
||||
%define PM_REMOVE 0x0001
|
||||
%define PM_NOYIELD 0x0002
|
||||
|
||||
%define VK_ESCAPE 0x1b
|
||||
%define VK_R 0x52
|
||||
|
||||
%define STD_OUTPUT_HANDLE -11
|
||||
%define STD_ERROR_HANDLE -12
|
||||
|
||||
%define WS_OVERLAPPED 0x00000000
|
||||
%define WS_POPUP 0x80000000
|
||||
%define WS_CHILD 0x40000000
|
||||
%define WS_MINIMIZE 0x20000000
|
||||
%define WS_VISIBLE 0x10000000
|
||||
%define WS_DISABLED 0x08000000
|
||||
%define WS_CLIPSIBLINGS 0x04000000
|
||||
%define WS_CLIPCHILDREN 0x02000000
|
||||
%define WS_MAXIMIZE 0x01000000
|
||||
%define WS_CAPTION 0x00C00000
|
||||
%define WS_BORDER 0x00800000
|
||||
%define WS_DLGFRAME 0x00400000
|
||||
%define WS_VSCROLL 0x00200000
|
||||
%define WS_HSCROLL 0x00100000
|
||||
%define WS_SYSMENU 0x00080000
|
||||
%define WS_THICKFRAME 0x00040000
|
||||
%define WS_GROUP 0x00020000
|
||||
%define WS_TABSTOP 0x00010000
|
||||
%define WS_MINIMIZEBOX 0x00020000
|
||||
%define WS_MAXIMIZEBOX 0x00010000
|
||||
|
||||
%define WS_TILED WS_OVERLAPPED
|
||||
%define WS_ICONIC WS_MINIMIZE
|
||||
%define WS_SIZEBOX WS_THICKFRAME
|
||||
%define WS_TILEDWINDOW WS_OVERLAPPEDWINDOW
|
||||
|
||||
%define WS_EX_DLGMODALFRAME 0x00000001
|
||||
%define WS_EX_NOPARENTNOTIFY 0x00000004
|
||||
%define WS_EX_TOPMOST 0x00000008
|
||||
%define WS_EX_ACCEPTFILES 0x00000010
|
||||
%define WS_EX_TRANSPARENT 0x00000020
|
||||
%define WS_EX_MDICHILD 0x00000040
|
||||
%define WS_EX_TOOLWINDOW 0x00000080
|
||||
%define WS_EX_WINDOWEDGE 0x00000100
|
||||
%define WS_EX_CLIENTEDGE 0x00000200
|
||||
%define WS_EX_CONTEXTHELP 0x00000400
|
||||
|
||||
%define OUT_DEFAULT_PRECIS 0
|
||||
%define OUT_STRING_PRECIS 1
|
||||
%define OUT_CHARACTER_PRECIS 2
|
||||
%define OUT_STROKE_PRECIS 3
|
||||
%define OUT_TT_PRECIS 4
|
||||
%define OUT_DEVICE_PRECIS 5
|
||||
%define OUT_RASTER_PRECIS 6
|
||||
%define OUT_TT_ONLY_PRECIS 7
|
||||
%define OUT_OUTLINE_PRECIS 8
|
||||
%define OUT_SCREEN_OUTLINE_PRECIS 9
|
||||
%define OUT_PS_ONLY_PRECIS 10
|
||||
|
||||
%define MB_OK 0x00000000
|
||||
%define MB_OKCANCEL 0x00000001
|
||||
%define MB_ABORTRETRYIGNORE 0x00000002
|
||||
%define MB_YESNOCANCEL 0x00000003
|
||||
%define MB_YESNO 0x00000004
|
||||
%define MB_RETRYCANCEL 0x00000005
|
||||
%define MB_CANCELTRYCONTINUE 0x00000006
|
||||
%define MB_ICONHAND 0x00000010
|
||||
%define MB_ICONQUESTION 0x00000020
|
||||
%define MB_ICONEXCLAMATION 0x00000030
|
||||
%define MB_ICONASTERISK 0x00000040
|
||||
%define MB_USERICON 0x00000080
|
||||
%define MB_ICONWARNING MB_ICONEXCLAMATION
|
||||
%define MB_ICONERROR MB_ICONHAND
|
||||
%define MB_ICONINFORMATION MB_ICONASTERISK
|
||||
%define MB_ICONSTOP MB_ICONHAND
|
||||
|
||||
%define DT_TOP 0x00000000
|
||||
%define DT_LEFT 0x00000000
|
||||
%define DT_CENTER 0x00000001
|
||||
%define DT_RIGHT 0x00000002
|
||||
%define DT_VCENTER 0x00000004
|
||||
%define DT_BOTTOM 0x00000008
|
||||
%define DT_WORDBREAK 0x00000010
|
||||
%define DT_SINGLELINE 0x00000020
|
||||
%define DT_EXPANDTABS 0x00000040
|
||||
%define DT_TABSTOP 0x00000080
|
||||
%define DT_NOCLIP 0x00000100
|
||||
%define DT_EXTERNALLEADING 0x00000200
|
||||
%define DT_CALCRECT 0x00000400
|
||||
%define DT_NOPREFIX 0x00000800
|
||||
%define DT_INTERNAL 0x00001000
|
||||
%define DT_EDITCONTROL 0x00002000
|
||||
%define DT_PATH_ELLIPSIS 0x00004000
|
||||
%define DT_END_ELLIPSIS 0x00008000
|
||||
%define DT_MODIFYSTRING 0x00010000
|
||||
%define DT_RTLREADING 0x00020000
|
||||
%define DT_WORD_ELLIPSIS 0x00040000
|
||||
%define DT_NOFULLWIDTHCHARBREAK 0x00080000
|
||||
%define DT_HIDEPREFIX 0x00100000
|
||||
%define DT_PREFIXONLY 0x00200000
|
||||
|
||||
%define OPEN_EXISTING 3
|
||||
%define FILE_SHARE_READ 1
|
||||
|
||||
%define FW_DONTCARE 0
|
||||
%define FW_THIN 100
|
||||
%define FW_EXTRALIGHT 200
|
||||
%define FW_LIGHT 300
|
||||
%define FW_NORMAL 400
|
||||
%define FW_MEDIUM 500
|
||||
%define FW_SEMIBOLD 600
|
||||
%define FW_BOLD 700
|
||||
%define FW_EXTRABOLD 800
|
||||
%define FW_HEAVY 900
|
||||
|
||||
%define CLIP_DEFAULT_PRECIS 0
|
||||
%define CLIP_CHARACTER_PRECIS 1
|
||||
%define CLIP_STROKE_PRECIS 2
|
||||
%define CLIP_MASK 15
|
||||
%define CLIP_LH_ANGLES (1 << 4)
|
||||
%define CLIP_TT_ALWAYS (2 << 4)
|
||||
%define CLIP_EMBEDDED (8 << 4)
|
||||
|
||||
%define DEFAULT_QUALITY 0
|
||||
%define DRAFT_QUALITY 1
|
||||
%define PROOF_QUALITY 2
|
||||
%define NONANTIALIASED_QUALITY 3
|
||||
%define ANTIALIASED_QUALITY 4
|
||||
|
||||
%define DEFAULT_PITCH 0
|
||||
%define FIXED_PITCH 1
|
||||
%define VARIABLE_PITCH 2
|
||||
%define MONO_FONT 8;
|
||||
|
||||
%define ANSI_CHARSET 0
|
||||
%define DEFAULT_CHARSET 1
|
||||
%define SYMBOL_CHARSET 2
|
||||
%define SHIFTJIS_CHARSET 0x80
|
||||
%define HANGEUL_CHARSET 129
|
||||
%define GB2312_CHARSET 134
|
||||
%define CHINESEBIG5_CHARSET 136
|
||||
%define OEM_CHARSET 255
|
||||
%define JOHAB_CHARSET 130
|
||||
%define HEBREW_CHARSET 177
|
||||
%define ARABIC_CHARSET 178
|
||||
%define GREEK_CHARSET 161
|
||||
%define TURKISH_CHARSET 162
|
||||
%define VIETNAMESE_CHARSET 163
|
||||
%define THAI_CHARSET 222
|
||||
%define EASTEUROPE_CHARSET 238
|
||||
%define RUSSIAN_CHARSET 204
|
||||
%define MAC_CHARSET 77
|
||||
%define BALTIC_CHARSET 186
|
||||
|
||||
%define FS_LATIN1 1
|
||||
%define FS_LATIN2 2
|
||||
%define FS_CYRILLIC 4
|
||||
%define FS_GREEK 8
|
||||
%define FS_TURKISH 0x10
|
||||
%define FS_HEBREW 0x20
|
||||
%define FS_ARABIC 0x40
|
||||
%define FS_BALTIC 0x80
|
||||
%define FS_VIETNAMESE 0x00000100
|
||||
%define FS_THAI 0x10000
|
||||
%define FS_JISJAPAN 0x20000
|
||||
%define FS_CHINESESIMP 0x40000
|
||||
%define FS_WANSUNG 0x80000
|
||||
%define FS_CHINESETRAD 0x100000
|
||||
%define FS_JOHAB 0x200000
|
||||
%define FS_SYMBOL 0x80000000
|
||||
|
||||
%define FF_DONTCARE (0 << 4)
|
||||
%define FF_ROMAN (1 << 4)
|
||||
%define FF_SWISS (2 << 4)
|
||||
%define FF_MODERN (3 << 4)
|
||||
%define FF_SCRIPT (4 << 4)
|
||||
%define FF_DECORATIVE (5 << 4)
|
||||
12
hgplus/las/framework-dx11-nasm/tools/clean.bat
Normal file
12
hgplus/las/framework-dx11-nasm/tools/clean.bat
Normal file
@@ -0,0 +1,12 @@
|
||||
del /S *.opensdf
|
||||
del /S *.sdf
|
||||
del /S /AH *.suo
|
||||
del *.html
|
||||
del /S *.tlog
|
||||
del /S *.lastbuildstate
|
||||
del /S *.pdb
|
||||
del /S *.log
|
||||
del /S *.obj
|
||||
del /S *.ilk
|
||||
del /S *.ptx
|
||||
del /S *.mglsl
|
||||
BIN
hgplus/las/framework-dx11-nasm/tools/crinkler.exe
Normal file
BIN
hgplus/las/framework-dx11-nasm/tools/crinkler.exe
Normal file
Binary file not shown.
14524
hgplus/las/framework-dx11-nasm/tools/headerGenerator/d3d11.h
Normal file
14524
hgplus/las/framework-dx11-nasm/tools/headerGenerator/d3d11.h
Normal file
File diff suppressed because it is too large
Load Diff
2333
hgplus/las/framework-dx11-nasm/tools/headerGenerator/d3d11.inc
Normal file
2333
hgplus/las/framework-dx11-nasm/tools/headerGenerator/d3d11.inc
Normal file
File diff suppressed because it is too large
Load Diff
846
hgplus/las/framework-dx11-nasm/tools/headerGenerator/d3dcommon.h
Normal file
846
hgplus/las/framework-dx11-nasm/tools/headerGenerator/d3dcommon.h
Normal file
@@ -0,0 +1,846 @@
|
||||
|
||||
|
||||
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
|
||||
|
||||
|
||||
/* File created by MIDL compiler version 8.00.0595 */
|
||||
/* @@MIDL_FILE_HEADING( ) */
|
||||
|
||||
#pragma warning( disable: 4049 ) /* more than 64k source lines */
|
||||
|
||||
|
||||
/* verify that the <rpcndr.h> version is high enough to compile this file*/
|
||||
#ifndef __REQUIRED_RPCNDR_H_VERSION__
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 500
|
||||
#endif
|
||||
|
||||
/* verify that the <rpcsal.h> version is high enough to compile this file*/
|
||||
#ifndef __REQUIRED_RPCSAL_H_VERSION__
|
||||
#define __REQUIRED_RPCSAL_H_VERSION__ 100
|
||||
#endif
|
||||
|
||||
#include "rpc.h"
|
||||
#include "rpcndr.h"
|
||||
|
||||
#ifndef __RPCNDR_H_VERSION__
|
||||
#error this stub requires an updated version of <rpcndr.h>
|
||||
#endif // __RPCNDR_H_VERSION__
|
||||
|
||||
#ifndef COM_NO_WINDOWS_H
|
||||
#include "windows.h"
|
||||
#include "ole2.h"
|
||||
#endif /*COM_NO_WINDOWS_H*/
|
||||
|
||||
#ifndef __d3dcommon_h__
|
||||
#define __d3dcommon_h__
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
/* Forward Declarations */
|
||||
|
||||
#ifndef __ID3D10Blob_FWD_DEFINED__
|
||||
#define __ID3D10Blob_FWD_DEFINED__
|
||||
typedef interface ID3D10Blob ID3D10Blob;
|
||||
|
||||
#endif /* __ID3D10Blob_FWD_DEFINED__ */
|
||||
|
||||
|
||||
/* header files for imported files */
|
||||
#include "oaidl.h"
|
||||
#include "ocidl.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
|
||||
|
||||
/* interface __MIDL_itf_d3dcommon_0000_0000 */
|
||||
/* [local] */
|
||||
|
||||
typedef
|
||||
enum D3D_DRIVER_TYPE
|
||||
{
|
||||
D3D_DRIVER_TYPE_UNKNOWN = 0,
|
||||
D3D_DRIVER_TYPE_HARDWARE = ( D3D_DRIVER_TYPE_UNKNOWN + 1 ) ,
|
||||
D3D_DRIVER_TYPE_REFERENCE = ( D3D_DRIVER_TYPE_HARDWARE + 1 ) ,
|
||||
D3D_DRIVER_TYPE_NULL = ( D3D_DRIVER_TYPE_REFERENCE + 1 ) ,
|
||||
D3D_DRIVER_TYPE_SOFTWARE = ( D3D_DRIVER_TYPE_NULL + 1 ) ,
|
||||
D3D_DRIVER_TYPE_WARP = ( D3D_DRIVER_TYPE_SOFTWARE + 1 )
|
||||
} D3D_DRIVER_TYPE;
|
||||
|
||||
typedef
|
||||
enum D3D_FEATURE_LEVEL
|
||||
{
|
||||
D3D_FEATURE_LEVEL_9_1 = 0x9100,
|
||||
D3D_FEATURE_LEVEL_9_2 = 0x9200,
|
||||
D3D_FEATURE_LEVEL_9_3 = 0x9300,
|
||||
D3D_FEATURE_LEVEL_10_0 = 0xa000,
|
||||
D3D_FEATURE_LEVEL_10_1 = 0xa100,
|
||||
D3D_FEATURE_LEVEL_11_0 = 0xb000,
|
||||
D3D_FEATURE_LEVEL_11_1 = 0xb100
|
||||
} D3D_FEATURE_LEVEL;
|
||||
|
||||
#define D3D_FL9_1_REQ_TEXTURE1D_U_DIMENSION 2048
|
||||
#define D3D_FL9_3_REQ_TEXTURE1D_U_DIMENSION 4096
|
||||
#define D3D_FL9_1_REQ_TEXTURE2D_U_OR_V_DIMENSION 2048
|
||||
#define D3D_FL9_3_REQ_TEXTURE2D_U_OR_V_DIMENSION 4096
|
||||
#define D3D_FL9_1_REQ_TEXTURECUBE_DIMENSION 512
|
||||
#define D3D_FL9_3_REQ_TEXTURECUBE_DIMENSION 4096
|
||||
#define D3D_FL9_1_REQ_TEXTURE3D_U_V_OR_W_DIMENSION 256
|
||||
#define D3D_FL9_1_DEFAULT_MAX_ANISOTROPY 2
|
||||
#define D3D_FL9_1_IA_PRIMITIVE_MAX_COUNT 65535
|
||||
#define D3D_FL9_2_IA_PRIMITIVE_MAX_COUNT 1048575
|
||||
#define D3D_FL9_1_SIMULTANEOUS_RENDER_TARGET_COUNT 1
|
||||
#define D3D_FL9_3_SIMULTANEOUS_RENDER_TARGET_COUNT 4
|
||||
#define D3D_FL9_1_MAX_TEXTURE_REPEAT 128
|
||||
#define D3D_FL9_2_MAX_TEXTURE_REPEAT 2048
|
||||
#define D3D_FL9_3_MAX_TEXTURE_REPEAT 8192
|
||||
typedef
|
||||
enum D3D_PRIMITIVE_TOPOLOGY
|
||||
{
|
||||
D3D_PRIMITIVE_TOPOLOGY_UNDEFINED = 0,
|
||||
D3D_PRIMITIVE_TOPOLOGY_POINTLIST = 1,
|
||||
D3D_PRIMITIVE_TOPOLOGY_LINELIST = 2,
|
||||
D3D_PRIMITIVE_TOPOLOGY_LINESTRIP = 3,
|
||||
D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST = 4,
|
||||
D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP = 5,
|
||||
D3D_PRIMITIVE_TOPOLOGY_LINELIST_ADJ = 10,
|
||||
D3D_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ = 11,
|
||||
D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ = 12,
|
||||
D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ = 13,
|
||||
D3D_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST = 33,
|
||||
D3D_PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST = 34,
|
||||
D3D_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST = 35,
|
||||
D3D_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST = 36,
|
||||
D3D_PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST = 37,
|
||||
D3D_PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST = 38,
|
||||
D3D_PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST = 39,
|
||||
D3D_PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST = 40,
|
||||
D3D_PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST = 41,
|
||||
D3D_PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST = 42,
|
||||
D3D_PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST = 43,
|
||||
D3D_PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST = 44,
|
||||
D3D_PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST = 45,
|
||||
D3D_PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST = 46,
|
||||
D3D_PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST = 47,
|
||||
D3D_PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST = 48,
|
||||
D3D_PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST = 49,
|
||||
D3D_PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST = 50,
|
||||
D3D_PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST = 51,
|
||||
D3D_PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST = 52,
|
||||
D3D_PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST = 53,
|
||||
D3D_PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST = 54,
|
||||
D3D_PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST = 55,
|
||||
D3D_PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST = 56,
|
||||
D3D_PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST = 57,
|
||||
D3D_PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST = 58,
|
||||
D3D_PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST = 59,
|
||||
D3D_PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST = 60,
|
||||
D3D_PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST = 61,
|
||||
D3D_PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST = 62,
|
||||
D3D_PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST = 63,
|
||||
D3D_PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST = 64,
|
||||
D3D10_PRIMITIVE_TOPOLOGY_UNDEFINED = D3D_PRIMITIVE_TOPOLOGY_UNDEFINED,
|
||||
D3D10_PRIMITIVE_TOPOLOGY_POINTLIST = D3D_PRIMITIVE_TOPOLOGY_POINTLIST,
|
||||
D3D10_PRIMITIVE_TOPOLOGY_LINELIST = D3D_PRIMITIVE_TOPOLOGY_LINELIST,
|
||||
D3D10_PRIMITIVE_TOPOLOGY_LINESTRIP = D3D_PRIMITIVE_TOPOLOGY_LINESTRIP,
|
||||
D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST,
|
||||
D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP = D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP,
|
||||
D3D10_PRIMITIVE_TOPOLOGY_LINELIST_ADJ = D3D_PRIMITIVE_TOPOLOGY_LINELIST_ADJ,
|
||||
D3D10_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ = D3D_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ,
|
||||
D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ,
|
||||
D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ = D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_UNDEFINED = D3D_PRIMITIVE_TOPOLOGY_UNDEFINED,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_POINTLIST = D3D_PRIMITIVE_TOPOLOGY_POINTLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_LINELIST = D3D_PRIMITIVE_TOPOLOGY_LINELIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP = D3D_PRIMITIVE_TOPOLOGY_LINESTRIP,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP = D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_LINELIST_ADJ = D3D_PRIMITIVE_TOPOLOGY_LINELIST_ADJ,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ = D3D_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ = D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST
|
||||
} D3D_PRIMITIVE_TOPOLOGY;
|
||||
|
||||
typedef
|
||||
enum D3D_PRIMITIVE
|
||||
{
|
||||
D3D_PRIMITIVE_UNDEFINED = 0,
|
||||
D3D_PRIMITIVE_POINT = 1,
|
||||
D3D_PRIMITIVE_LINE = 2,
|
||||
D3D_PRIMITIVE_TRIANGLE = 3,
|
||||
D3D_PRIMITIVE_LINE_ADJ = 6,
|
||||
D3D_PRIMITIVE_TRIANGLE_ADJ = 7,
|
||||
D3D_PRIMITIVE_1_CONTROL_POINT_PATCH = 8,
|
||||
D3D_PRIMITIVE_2_CONTROL_POINT_PATCH = 9,
|
||||
D3D_PRIMITIVE_3_CONTROL_POINT_PATCH = 10,
|
||||
D3D_PRIMITIVE_4_CONTROL_POINT_PATCH = 11,
|
||||
D3D_PRIMITIVE_5_CONTROL_POINT_PATCH = 12,
|
||||
D3D_PRIMITIVE_6_CONTROL_POINT_PATCH = 13,
|
||||
D3D_PRIMITIVE_7_CONTROL_POINT_PATCH = 14,
|
||||
D3D_PRIMITIVE_8_CONTROL_POINT_PATCH = 15,
|
||||
D3D_PRIMITIVE_9_CONTROL_POINT_PATCH = 16,
|
||||
D3D_PRIMITIVE_10_CONTROL_POINT_PATCH = 17,
|
||||
D3D_PRIMITIVE_11_CONTROL_POINT_PATCH = 18,
|
||||
D3D_PRIMITIVE_12_CONTROL_POINT_PATCH = 19,
|
||||
D3D_PRIMITIVE_13_CONTROL_POINT_PATCH = 20,
|
||||
D3D_PRIMITIVE_14_CONTROL_POINT_PATCH = 21,
|
||||
D3D_PRIMITIVE_15_CONTROL_POINT_PATCH = 22,
|
||||
D3D_PRIMITIVE_16_CONTROL_POINT_PATCH = 23,
|
||||
D3D_PRIMITIVE_17_CONTROL_POINT_PATCH = 24,
|
||||
D3D_PRIMITIVE_18_CONTROL_POINT_PATCH = 25,
|
||||
D3D_PRIMITIVE_19_CONTROL_POINT_PATCH = 26,
|
||||
D3D_PRIMITIVE_20_CONTROL_POINT_PATCH = 28,
|
||||
D3D_PRIMITIVE_21_CONTROL_POINT_PATCH = 29,
|
||||
D3D_PRIMITIVE_22_CONTROL_POINT_PATCH = 30,
|
||||
D3D_PRIMITIVE_23_CONTROL_POINT_PATCH = 31,
|
||||
D3D_PRIMITIVE_24_CONTROL_POINT_PATCH = 32,
|
||||
D3D_PRIMITIVE_25_CONTROL_POINT_PATCH = 33,
|
||||
D3D_PRIMITIVE_26_CONTROL_POINT_PATCH = 34,
|
||||
D3D_PRIMITIVE_27_CONTROL_POINT_PATCH = 35,
|
||||
D3D_PRIMITIVE_28_CONTROL_POINT_PATCH = 36,
|
||||
D3D_PRIMITIVE_29_CONTROL_POINT_PATCH = 37,
|
||||
D3D_PRIMITIVE_30_CONTROL_POINT_PATCH = 38,
|
||||
D3D_PRIMITIVE_31_CONTROL_POINT_PATCH = 39,
|
||||
D3D_PRIMITIVE_32_CONTROL_POINT_PATCH = 40,
|
||||
D3D10_PRIMITIVE_UNDEFINED = D3D_PRIMITIVE_UNDEFINED,
|
||||
D3D10_PRIMITIVE_POINT = D3D_PRIMITIVE_POINT,
|
||||
D3D10_PRIMITIVE_LINE = D3D_PRIMITIVE_LINE,
|
||||
D3D10_PRIMITIVE_TRIANGLE = D3D_PRIMITIVE_TRIANGLE,
|
||||
D3D10_PRIMITIVE_LINE_ADJ = D3D_PRIMITIVE_LINE_ADJ,
|
||||
D3D10_PRIMITIVE_TRIANGLE_ADJ = D3D_PRIMITIVE_TRIANGLE_ADJ,
|
||||
D3D11_PRIMITIVE_UNDEFINED = D3D_PRIMITIVE_UNDEFINED,
|
||||
D3D11_PRIMITIVE_POINT = D3D_PRIMITIVE_POINT,
|
||||
D3D11_PRIMITIVE_LINE = D3D_PRIMITIVE_LINE,
|
||||
D3D11_PRIMITIVE_TRIANGLE = D3D_PRIMITIVE_TRIANGLE,
|
||||
D3D11_PRIMITIVE_LINE_ADJ = D3D_PRIMITIVE_LINE_ADJ,
|
||||
D3D11_PRIMITIVE_TRIANGLE_ADJ = D3D_PRIMITIVE_TRIANGLE_ADJ,
|
||||
D3D11_PRIMITIVE_1_CONTROL_POINT_PATCH = D3D_PRIMITIVE_1_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_2_CONTROL_POINT_PATCH = D3D_PRIMITIVE_2_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_3_CONTROL_POINT_PATCH = D3D_PRIMITIVE_3_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_4_CONTROL_POINT_PATCH = D3D_PRIMITIVE_4_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_5_CONTROL_POINT_PATCH = D3D_PRIMITIVE_5_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_6_CONTROL_POINT_PATCH = D3D_PRIMITIVE_6_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_7_CONTROL_POINT_PATCH = D3D_PRIMITIVE_7_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_8_CONTROL_POINT_PATCH = D3D_PRIMITIVE_8_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_9_CONTROL_POINT_PATCH = D3D_PRIMITIVE_9_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_10_CONTROL_POINT_PATCH = D3D_PRIMITIVE_10_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_11_CONTROL_POINT_PATCH = D3D_PRIMITIVE_11_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_12_CONTROL_POINT_PATCH = D3D_PRIMITIVE_12_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_13_CONTROL_POINT_PATCH = D3D_PRIMITIVE_13_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_14_CONTROL_POINT_PATCH = D3D_PRIMITIVE_14_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_15_CONTROL_POINT_PATCH = D3D_PRIMITIVE_15_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_16_CONTROL_POINT_PATCH = D3D_PRIMITIVE_16_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_17_CONTROL_POINT_PATCH = D3D_PRIMITIVE_17_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_18_CONTROL_POINT_PATCH = D3D_PRIMITIVE_18_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_19_CONTROL_POINT_PATCH = D3D_PRIMITIVE_19_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_20_CONTROL_POINT_PATCH = D3D_PRIMITIVE_20_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_21_CONTROL_POINT_PATCH = D3D_PRIMITIVE_21_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_22_CONTROL_POINT_PATCH = D3D_PRIMITIVE_22_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_23_CONTROL_POINT_PATCH = D3D_PRIMITIVE_23_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_24_CONTROL_POINT_PATCH = D3D_PRIMITIVE_24_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_25_CONTROL_POINT_PATCH = D3D_PRIMITIVE_25_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_26_CONTROL_POINT_PATCH = D3D_PRIMITIVE_26_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_27_CONTROL_POINT_PATCH = D3D_PRIMITIVE_27_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_28_CONTROL_POINT_PATCH = D3D_PRIMITIVE_28_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_29_CONTROL_POINT_PATCH = D3D_PRIMITIVE_29_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_30_CONTROL_POINT_PATCH = D3D_PRIMITIVE_30_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_31_CONTROL_POINT_PATCH = D3D_PRIMITIVE_31_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_32_CONTROL_POINT_PATCH = D3D_PRIMITIVE_32_CONTROL_POINT_PATCH
|
||||
} D3D_PRIMITIVE;
|
||||
|
||||
typedef
|
||||
enum D3D_SRV_DIMENSION
|
||||
{
|
||||
D3D_SRV_DIMENSION_UNKNOWN = 0,
|
||||
D3D_SRV_DIMENSION_BUFFER = 1,
|
||||
D3D_SRV_DIMENSION_TEXTURE1D = 2,
|
||||
D3D_SRV_DIMENSION_TEXTURE1DARRAY = 3,
|
||||
D3D_SRV_DIMENSION_TEXTURE2D = 4,
|
||||
D3D_SRV_DIMENSION_TEXTURE2DARRAY = 5,
|
||||
D3D_SRV_DIMENSION_TEXTURE2DMS = 6,
|
||||
D3D_SRV_DIMENSION_TEXTURE2DMSARRAY = 7,
|
||||
D3D_SRV_DIMENSION_TEXTURE3D = 8,
|
||||
D3D_SRV_DIMENSION_TEXTURECUBE = 9,
|
||||
D3D_SRV_DIMENSION_TEXTURECUBEARRAY = 10,
|
||||
D3D_SRV_DIMENSION_BUFFEREX = 11,
|
||||
D3D10_SRV_DIMENSION_UNKNOWN = D3D_SRV_DIMENSION_UNKNOWN,
|
||||
D3D10_SRV_DIMENSION_BUFFER = D3D_SRV_DIMENSION_BUFFER,
|
||||
D3D10_SRV_DIMENSION_TEXTURE1D = D3D_SRV_DIMENSION_TEXTURE1D,
|
||||
D3D10_SRV_DIMENSION_TEXTURE1DARRAY = D3D_SRV_DIMENSION_TEXTURE1DARRAY,
|
||||
D3D10_SRV_DIMENSION_TEXTURE2D = D3D_SRV_DIMENSION_TEXTURE2D,
|
||||
D3D10_SRV_DIMENSION_TEXTURE2DARRAY = D3D_SRV_DIMENSION_TEXTURE2DARRAY,
|
||||
D3D10_SRV_DIMENSION_TEXTURE2DMS = D3D_SRV_DIMENSION_TEXTURE2DMS,
|
||||
D3D10_SRV_DIMENSION_TEXTURE2DMSARRAY = D3D_SRV_DIMENSION_TEXTURE2DMSARRAY,
|
||||
D3D10_SRV_DIMENSION_TEXTURE3D = D3D_SRV_DIMENSION_TEXTURE3D,
|
||||
D3D10_SRV_DIMENSION_TEXTURECUBE = D3D_SRV_DIMENSION_TEXTURECUBE,
|
||||
D3D10_1_SRV_DIMENSION_UNKNOWN = D3D_SRV_DIMENSION_UNKNOWN,
|
||||
D3D10_1_SRV_DIMENSION_BUFFER = D3D_SRV_DIMENSION_BUFFER,
|
||||
D3D10_1_SRV_DIMENSION_TEXTURE1D = D3D_SRV_DIMENSION_TEXTURE1D,
|
||||
D3D10_1_SRV_DIMENSION_TEXTURE1DARRAY = D3D_SRV_DIMENSION_TEXTURE1DARRAY,
|
||||
D3D10_1_SRV_DIMENSION_TEXTURE2D = D3D_SRV_DIMENSION_TEXTURE2D,
|
||||
D3D10_1_SRV_DIMENSION_TEXTURE2DARRAY = D3D_SRV_DIMENSION_TEXTURE2DARRAY,
|
||||
D3D10_1_SRV_DIMENSION_TEXTURE2DMS = D3D_SRV_DIMENSION_TEXTURE2DMS,
|
||||
D3D10_1_SRV_DIMENSION_TEXTURE2DMSARRAY = D3D_SRV_DIMENSION_TEXTURE2DMSARRAY,
|
||||
D3D10_1_SRV_DIMENSION_TEXTURE3D = D3D_SRV_DIMENSION_TEXTURE3D,
|
||||
D3D10_1_SRV_DIMENSION_TEXTURECUBE = D3D_SRV_DIMENSION_TEXTURECUBE,
|
||||
D3D10_1_SRV_DIMENSION_TEXTURECUBEARRAY = D3D_SRV_DIMENSION_TEXTURECUBEARRAY,
|
||||
D3D11_SRV_DIMENSION_UNKNOWN = D3D_SRV_DIMENSION_UNKNOWN,
|
||||
D3D11_SRV_DIMENSION_BUFFER = D3D_SRV_DIMENSION_BUFFER,
|
||||
D3D11_SRV_DIMENSION_TEXTURE1D = D3D_SRV_DIMENSION_TEXTURE1D,
|
||||
D3D11_SRV_DIMENSION_TEXTURE1DARRAY = D3D_SRV_DIMENSION_TEXTURE1DARRAY,
|
||||
D3D11_SRV_DIMENSION_TEXTURE2D = D3D_SRV_DIMENSION_TEXTURE2D,
|
||||
D3D11_SRV_DIMENSION_TEXTURE2DARRAY = D3D_SRV_DIMENSION_TEXTURE2DARRAY,
|
||||
D3D11_SRV_DIMENSION_TEXTURE2DMS = D3D_SRV_DIMENSION_TEXTURE2DMS,
|
||||
D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY = D3D_SRV_DIMENSION_TEXTURE2DMSARRAY,
|
||||
D3D11_SRV_DIMENSION_TEXTURE3D = D3D_SRV_DIMENSION_TEXTURE3D,
|
||||
D3D11_SRV_DIMENSION_TEXTURECUBE = D3D_SRV_DIMENSION_TEXTURECUBE,
|
||||
D3D11_SRV_DIMENSION_TEXTURECUBEARRAY = D3D_SRV_DIMENSION_TEXTURECUBEARRAY,
|
||||
D3D11_SRV_DIMENSION_BUFFEREX = D3D_SRV_DIMENSION_BUFFEREX
|
||||
} D3D_SRV_DIMENSION;
|
||||
|
||||
typedef struct _D3D_SHADER_MACRO
|
||||
{
|
||||
LPCSTR Name;
|
||||
LPCSTR Definition;
|
||||
} D3D_SHADER_MACRO;
|
||||
|
||||
typedef struct _D3D_SHADER_MACRO *LPD3D_SHADER_MACRO;
|
||||
|
||||
DEFINE_GUID(IID_ID3D10Blob, 0x8ba5fb08, 0x5195, 0x40e2, 0xac, 0x58, 0xd, 0x98, 0x9c, 0x3a, 0x1, 0x2);
|
||||
|
||||
|
||||
extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0000_v0_0_c_ifspec;
|
||||
extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0000_v0_0_s_ifspec;
|
||||
|
||||
#ifndef __ID3D10Blob_INTERFACE_DEFINED__
|
||||
#define __ID3D10Blob_INTERFACE_DEFINED__
|
||||
|
||||
/* interface ID3D10Blob */
|
||||
/* [unique][local][object][uuid] */
|
||||
|
||||
|
||||
EXTERN_C const IID IID_ID3D10Blob;
|
||||
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
|
||||
MIDL_INTERFACE("8BA5FB08-5195-40e2-AC58-0D989C3A0102")
|
||||
ID3D10Blob : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual LPVOID STDMETHODCALLTYPE GetBufferPointer( void) = 0;
|
||||
|
||||
virtual SIZE_T STDMETHODCALLTYPE GetBufferSize( void) = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#else /* C style interface */
|
||||
|
||||
typedef struct ID3D10BlobVtbl
|
||||
{
|
||||
BEGIN_INTERFACE
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
|
||||
ID3D10Blob * This,
|
||||
/* [in] */ REFIID riid,
|
||||
/* [annotation][iid_is][out] */
|
||||
_COM_Outptr_ void **ppvObject);
|
||||
|
||||
ULONG ( STDMETHODCALLTYPE *AddRef )(
|
||||
ID3D10Blob * This);
|
||||
|
||||
ULONG ( STDMETHODCALLTYPE *Release )(
|
||||
ID3D10Blob * This);
|
||||
|
||||
LPVOID ( STDMETHODCALLTYPE *GetBufferPointer )(
|
||||
ID3D10Blob * This);
|
||||
|
||||
SIZE_T ( STDMETHODCALLTYPE *GetBufferSize )(
|
||||
ID3D10Blob * This);
|
||||
|
||||
END_INTERFACE
|
||||
} ID3D10BlobVtbl;
|
||||
|
||||
interface ID3D10Blob
|
||||
{
|
||||
CONST_VTBL struct ID3D10BlobVtbl *lpVtbl;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#ifdef COBJMACROS
|
||||
|
||||
|
||||
#define ID3D10Blob_QueryInterface(This,riid,ppvObject) \
|
||||
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
|
||||
|
||||
#define ID3D10Blob_AddRef(This) \
|
||||
( (This)->lpVtbl -> AddRef(This) )
|
||||
|
||||
#define ID3D10Blob_Release(This) \
|
||||
( (This)->lpVtbl -> Release(This) )
|
||||
|
||||
|
||||
#define ID3D10Blob_GetBufferPointer(This) \
|
||||
( (This)->lpVtbl -> GetBufferPointer(This) )
|
||||
|
||||
#define ID3D10Blob_GetBufferSize(This) \
|
||||
( (This)->lpVtbl -> GetBufferSize(This) )
|
||||
|
||||
#endif /* COBJMACROS */
|
||||
|
||||
|
||||
#endif /* C style interface */
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* __ID3D10Blob_INTERFACE_DEFINED__ */
|
||||
|
||||
|
||||
/* interface __MIDL_itf_d3dcommon_0000_0001 */
|
||||
/* [local] */
|
||||
|
||||
typedef interface ID3D10Blob* LPD3D10BLOB;
|
||||
typedef ID3D10Blob ID3DBlob;
|
||||
typedef ID3DBlob* LPD3DBLOB;
|
||||
#define IID_ID3DBlob IID_ID3D10Blob
|
||||
typedef
|
||||
enum _D3D_INCLUDE_TYPE
|
||||
{
|
||||
D3D_INCLUDE_LOCAL = 0,
|
||||
D3D_INCLUDE_SYSTEM = ( D3D_INCLUDE_LOCAL + 1 ) ,
|
||||
D3D10_INCLUDE_LOCAL = D3D_INCLUDE_LOCAL,
|
||||
D3D10_INCLUDE_SYSTEM = D3D_INCLUDE_SYSTEM,
|
||||
D3D_INCLUDE_FORCE_DWORD = 0x7fffffff
|
||||
} D3D_INCLUDE_TYPE;
|
||||
|
||||
typedef interface ID3DInclude ID3DInclude;
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3DInclude
|
||||
DECLARE_INTERFACE(ID3DInclude)
|
||||
{
|
||||
STDMETHOD(Open)(THIS_ D3D_INCLUDE_TYPE IncludeType, LPCSTR pFileName, LPCVOID pParentData, LPCVOID *ppData, UINT *pBytes) PURE;
|
||||
STDMETHOD(Close)(THIS_ LPCVOID pData) PURE;
|
||||
};
|
||||
typedef ID3DInclude* LPD3DINCLUDE;
|
||||
typedef
|
||||
enum _D3D_SHADER_VARIABLE_CLASS
|
||||
{
|
||||
D3D_SVC_SCALAR = 0,
|
||||
D3D_SVC_VECTOR = ( D3D_SVC_SCALAR + 1 ) ,
|
||||
D3D_SVC_MATRIX_ROWS = ( D3D_SVC_VECTOR + 1 ) ,
|
||||
D3D_SVC_MATRIX_COLUMNS = ( D3D_SVC_MATRIX_ROWS + 1 ) ,
|
||||
D3D_SVC_OBJECT = ( D3D_SVC_MATRIX_COLUMNS + 1 ) ,
|
||||
D3D_SVC_STRUCT = ( D3D_SVC_OBJECT + 1 ) ,
|
||||
D3D_SVC_INTERFACE_CLASS = ( D3D_SVC_STRUCT + 1 ) ,
|
||||
D3D_SVC_INTERFACE_POINTER = ( D3D_SVC_INTERFACE_CLASS + 1 ) ,
|
||||
D3D10_SVC_SCALAR = D3D_SVC_SCALAR,
|
||||
D3D10_SVC_VECTOR = D3D_SVC_VECTOR,
|
||||
D3D10_SVC_MATRIX_ROWS = D3D_SVC_MATRIX_ROWS,
|
||||
D3D10_SVC_MATRIX_COLUMNS = D3D_SVC_MATRIX_COLUMNS,
|
||||
D3D10_SVC_OBJECT = D3D_SVC_OBJECT,
|
||||
D3D10_SVC_STRUCT = D3D_SVC_STRUCT,
|
||||
D3D11_SVC_INTERFACE_CLASS = D3D_SVC_INTERFACE_CLASS,
|
||||
D3D11_SVC_INTERFACE_POINTER = D3D_SVC_INTERFACE_POINTER,
|
||||
D3D_SVC_FORCE_DWORD = 0x7fffffff
|
||||
} D3D_SHADER_VARIABLE_CLASS;
|
||||
|
||||
typedef
|
||||
enum _D3D_SHADER_VARIABLE_FLAGS
|
||||
{
|
||||
D3D_SVF_USERPACKED = 1,
|
||||
D3D_SVF_USED = 2,
|
||||
D3D_SVF_INTERFACE_POINTER = 4,
|
||||
D3D_SVF_INTERFACE_PARAMETER = 8,
|
||||
D3D10_SVF_USERPACKED = D3D_SVF_USERPACKED,
|
||||
D3D10_SVF_USED = D3D_SVF_USED,
|
||||
D3D11_SVF_INTERFACE_POINTER = D3D_SVF_INTERFACE_POINTER,
|
||||
D3D11_SVF_INTERFACE_PARAMETER = D3D_SVF_INTERFACE_PARAMETER,
|
||||
D3D_SVF_FORCE_DWORD = 0x7fffffff
|
||||
} D3D_SHADER_VARIABLE_FLAGS;
|
||||
|
||||
typedef
|
||||
enum _D3D_SHADER_VARIABLE_TYPE
|
||||
{
|
||||
D3D_SVT_VOID = 0,
|
||||
D3D_SVT_BOOL = 1,
|
||||
D3D_SVT_INT = 2,
|
||||
D3D_SVT_FLOAT = 3,
|
||||
D3D_SVT_STRING = 4,
|
||||
D3D_SVT_TEXTURE = 5,
|
||||
D3D_SVT_TEXTURE1D = 6,
|
||||
D3D_SVT_TEXTURE2D = 7,
|
||||
D3D_SVT_TEXTURE3D = 8,
|
||||
D3D_SVT_TEXTURECUBE = 9,
|
||||
D3D_SVT_SAMPLER = 10,
|
||||
D3D_SVT_SAMPLER1D = 11,
|
||||
D3D_SVT_SAMPLER2D = 12,
|
||||
D3D_SVT_SAMPLER3D = 13,
|
||||
D3D_SVT_SAMPLERCUBE = 14,
|
||||
D3D_SVT_PIXELSHADER = 15,
|
||||
D3D_SVT_VERTEXSHADER = 16,
|
||||
D3D_SVT_PIXELFRAGMENT = 17,
|
||||
D3D_SVT_VERTEXFRAGMENT = 18,
|
||||
D3D_SVT_UINT = 19,
|
||||
D3D_SVT_UINT8 = 20,
|
||||
D3D_SVT_GEOMETRYSHADER = 21,
|
||||
D3D_SVT_RASTERIZER = 22,
|
||||
D3D_SVT_DEPTHSTENCIL = 23,
|
||||
D3D_SVT_BLEND = 24,
|
||||
D3D_SVT_BUFFER = 25,
|
||||
D3D_SVT_CBUFFER = 26,
|
||||
D3D_SVT_TBUFFER = 27,
|
||||
D3D_SVT_TEXTURE1DARRAY = 28,
|
||||
D3D_SVT_TEXTURE2DARRAY = 29,
|
||||
D3D_SVT_RENDERTARGETVIEW = 30,
|
||||
D3D_SVT_DEPTHSTENCILVIEW = 31,
|
||||
D3D_SVT_TEXTURE2DMS = 32,
|
||||
D3D_SVT_TEXTURE2DMSARRAY = 33,
|
||||
D3D_SVT_TEXTURECUBEARRAY = 34,
|
||||
D3D_SVT_HULLSHADER = 35,
|
||||
D3D_SVT_DOMAINSHADER = 36,
|
||||
D3D_SVT_INTERFACE_POINTER = 37,
|
||||
D3D_SVT_COMPUTESHADER = 38,
|
||||
D3D_SVT_DOUBLE = 39,
|
||||
D3D_SVT_RWTEXTURE1D = 40,
|
||||
D3D_SVT_RWTEXTURE1DARRAY = 41,
|
||||
D3D_SVT_RWTEXTURE2D = 42,
|
||||
D3D_SVT_RWTEXTURE2DARRAY = 43,
|
||||
D3D_SVT_RWTEXTURE3D = 44,
|
||||
D3D_SVT_RWBUFFER = 45,
|
||||
D3D_SVT_BYTEADDRESS_BUFFER = 46,
|
||||
D3D_SVT_RWBYTEADDRESS_BUFFER = 47,
|
||||
D3D_SVT_STRUCTURED_BUFFER = 48,
|
||||
D3D_SVT_RWSTRUCTURED_BUFFER = 49,
|
||||
D3D_SVT_APPEND_STRUCTURED_BUFFER = 50,
|
||||
D3D_SVT_CONSUME_STRUCTURED_BUFFER = 51,
|
||||
D3D_SVT_MIN8FLOAT = 52,
|
||||
D3D_SVT_MIN10FLOAT = 53,
|
||||
D3D_SVT_MIN16FLOAT = 54,
|
||||
D3D_SVT_MIN12INT = 55,
|
||||
D3D_SVT_MIN16INT = 56,
|
||||
D3D_SVT_MIN16UINT = 57,
|
||||
D3D10_SVT_VOID = D3D_SVT_VOID,
|
||||
D3D10_SVT_BOOL = D3D_SVT_BOOL,
|
||||
D3D10_SVT_INT = D3D_SVT_INT,
|
||||
D3D10_SVT_FLOAT = D3D_SVT_FLOAT,
|
||||
D3D10_SVT_STRING = D3D_SVT_STRING,
|
||||
D3D10_SVT_TEXTURE = D3D_SVT_TEXTURE,
|
||||
D3D10_SVT_TEXTURE1D = D3D_SVT_TEXTURE1D,
|
||||
D3D10_SVT_TEXTURE2D = D3D_SVT_TEXTURE2D,
|
||||
D3D10_SVT_TEXTURE3D = D3D_SVT_TEXTURE3D,
|
||||
D3D10_SVT_TEXTURECUBE = D3D_SVT_TEXTURECUBE,
|
||||
D3D10_SVT_SAMPLER = D3D_SVT_SAMPLER,
|
||||
D3D10_SVT_SAMPLER1D = D3D_SVT_SAMPLER1D,
|
||||
D3D10_SVT_SAMPLER2D = D3D_SVT_SAMPLER2D,
|
||||
D3D10_SVT_SAMPLER3D = D3D_SVT_SAMPLER3D,
|
||||
D3D10_SVT_SAMPLERCUBE = D3D_SVT_SAMPLERCUBE,
|
||||
D3D10_SVT_PIXELSHADER = D3D_SVT_PIXELSHADER,
|
||||
D3D10_SVT_VERTEXSHADER = D3D_SVT_VERTEXSHADER,
|
||||
D3D10_SVT_PIXELFRAGMENT = D3D_SVT_PIXELFRAGMENT,
|
||||
D3D10_SVT_VERTEXFRAGMENT = D3D_SVT_VERTEXFRAGMENT,
|
||||
D3D10_SVT_UINT = D3D_SVT_UINT,
|
||||
D3D10_SVT_UINT8 = D3D_SVT_UINT8,
|
||||
D3D10_SVT_GEOMETRYSHADER = D3D_SVT_GEOMETRYSHADER,
|
||||
D3D10_SVT_RASTERIZER = D3D_SVT_RASTERIZER,
|
||||
D3D10_SVT_DEPTHSTENCIL = D3D_SVT_DEPTHSTENCIL,
|
||||
D3D10_SVT_BLEND = D3D_SVT_BLEND,
|
||||
D3D10_SVT_BUFFER = D3D_SVT_BUFFER,
|
||||
D3D10_SVT_CBUFFER = D3D_SVT_CBUFFER,
|
||||
D3D10_SVT_TBUFFER = D3D_SVT_TBUFFER,
|
||||
D3D10_SVT_TEXTURE1DARRAY = D3D_SVT_TEXTURE1DARRAY,
|
||||
D3D10_SVT_TEXTURE2DARRAY = D3D_SVT_TEXTURE2DARRAY,
|
||||
D3D10_SVT_RENDERTARGETVIEW = D3D_SVT_RENDERTARGETVIEW,
|
||||
D3D10_SVT_DEPTHSTENCILVIEW = D3D_SVT_DEPTHSTENCILVIEW,
|
||||
D3D10_SVT_TEXTURE2DMS = D3D_SVT_TEXTURE2DMS,
|
||||
D3D10_SVT_TEXTURE2DMSARRAY = D3D_SVT_TEXTURE2DMSARRAY,
|
||||
D3D10_SVT_TEXTURECUBEARRAY = D3D_SVT_TEXTURECUBEARRAY,
|
||||
D3D11_SVT_HULLSHADER = D3D_SVT_HULLSHADER,
|
||||
D3D11_SVT_DOMAINSHADER = D3D_SVT_DOMAINSHADER,
|
||||
D3D11_SVT_INTERFACE_POINTER = D3D_SVT_INTERFACE_POINTER,
|
||||
D3D11_SVT_COMPUTESHADER = D3D_SVT_COMPUTESHADER,
|
||||
D3D11_SVT_DOUBLE = D3D_SVT_DOUBLE,
|
||||
D3D11_SVT_RWTEXTURE1D = D3D_SVT_RWTEXTURE1D,
|
||||
D3D11_SVT_RWTEXTURE1DARRAY = D3D_SVT_RWTEXTURE1DARRAY,
|
||||
D3D11_SVT_RWTEXTURE2D = D3D_SVT_RWTEXTURE2D,
|
||||
D3D11_SVT_RWTEXTURE2DARRAY = D3D_SVT_RWTEXTURE2DARRAY,
|
||||
D3D11_SVT_RWTEXTURE3D = D3D_SVT_RWTEXTURE3D,
|
||||
D3D11_SVT_RWBUFFER = D3D_SVT_RWBUFFER,
|
||||
D3D11_SVT_BYTEADDRESS_BUFFER = D3D_SVT_BYTEADDRESS_BUFFER,
|
||||
D3D11_SVT_RWBYTEADDRESS_BUFFER = D3D_SVT_RWBYTEADDRESS_BUFFER,
|
||||
D3D11_SVT_STRUCTURED_BUFFER = D3D_SVT_STRUCTURED_BUFFER,
|
||||
D3D11_SVT_RWSTRUCTURED_BUFFER = D3D_SVT_RWSTRUCTURED_BUFFER,
|
||||
D3D11_SVT_APPEND_STRUCTURED_BUFFER = D3D_SVT_APPEND_STRUCTURED_BUFFER,
|
||||
D3D11_SVT_CONSUME_STRUCTURED_BUFFER = D3D_SVT_CONSUME_STRUCTURED_BUFFER,
|
||||
D3D_SVT_FORCE_DWORD = 0x7fffffff
|
||||
} D3D_SHADER_VARIABLE_TYPE;
|
||||
|
||||
typedef
|
||||
enum _D3D_SHADER_INPUT_FLAGS
|
||||
{
|
||||
D3D_SIF_USERPACKED = 0x1,
|
||||
D3D_SIF_COMPARISON_SAMPLER = 0x2,
|
||||
D3D_SIF_TEXTURE_COMPONENT_0 = 0x4,
|
||||
D3D_SIF_TEXTURE_COMPONENT_1 = 0x8,
|
||||
D3D_SIF_TEXTURE_COMPONENTS = 0xc,
|
||||
D3D_SIF_UNUSED = 0x10,
|
||||
D3D10_SIF_USERPACKED = D3D_SIF_USERPACKED,
|
||||
D3D10_SIF_COMPARISON_SAMPLER = D3D_SIF_COMPARISON_SAMPLER,
|
||||
D3D10_SIF_TEXTURE_COMPONENT_0 = D3D_SIF_TEXTURE_COMPONENT_0,
|
||||
D3D10_SIF_TEXTURE_COMPONENT_1 = D3D_SIF_TEXTURE_COMPONENT_1,
|
||||
D3D10_SIF_TEXTURE_COMPONENTS = D3D_SIF_TEXTURE_COMPONENTS,
|
||||
D3D_SIF_FORCE_DWORD = 0x7fffffff
|
||||
} D3D_SHADER_INPUT_FLAGS;
|
||||
|
||||
typedef
|
||||
enum _D3D_SHADER_INPUT_TYPE
|
||||
{
|
||||
D3D_SIT_CBUFFER = 0,
|
||||
D3D_SIT_TBUFFER = ( D3D_SIT_CBUFFER + 1 ) ,
|
||||
D3D_SIT_TEXTURE = ( D3D_SIT_TBUFFER + 1 ) ,
|
||||
D3D_SIT_SAMPLER = ( D3D_SIT_TEXTURE + 1 ) ,
|
||||
D3D_SIT_UAV_RWTYPED = ( D3D_SIT_SAMPLER + 1 ) ,
|
||||
D3D_SIT_STRUCTURED = ( D3D_SIT_UAV_RWTYPED + 1 ) ,
|
||||
D3D_SIT_UAV_RWSTRUCTURED = ( D3D_SIT_STRUCTURED + 1 ) ,
|
||||
D3D_SIT_BYTEADDRESS = ( D3D_SIT_UAV_RWSTRUCTURED + 1 ) ,
|
||||
D3D_SIT_UAV_RWBYTEADDRESS = ( D3D_SIT_BYTEADDRESS + 1 ) ,
|
||||
D3D_SIT_UAV_APPEND_STRUCTURED = ( D3D_SIT_UAV_RWBYTEADDRESS + 1 ) ,
|
||||
D3D_SIT_UAV_CONSUME_STRUCTURED = ( D3D_SIT_UAV_APPEND_STRUCTURED + 1 ) ,
|
||||
D3D_SIT_UAV_RWSTRUCTURED_WITH_COUNTER = ( D3D_SIT_UAV_CONSUME_STRUCTURED + 1 ) ,
|
||||
D3D10_SIT_CBUFFER = D3D_SIT_CBUFFER,
|
||||
D3D10_SIT_TBUFFER = D3D_SIT_TBUFFER,
|
||||
D3D10_SIT_TEXTURE = D3D_SIT_TEXTURE,
|
||||
D3D10_SIT_SAMPLER = D3D_SIT_SAMPLER,
|
||||
D3D11_SIT_UAV_RWTYPED = D3D_SIT_UAV_RWTYPED,
|
||||
D3D11_SIT_STRUCTURED = D3D_SIT_STRUCTURED,
|
||||
D3D11_SIT_UAV_RWSTRUCTURED = D3D_SIT_UAV_RWSTRUCTURED,
|
||||
D3D11_SIT_BYTEADDRESS = D3D_SIT_BYTEADDRESS,
|
||||
D3D11_SIT_UAV_RWBYTEADDRESS = D3D_SIT_UAV_RWBYTEADDRESS,
|
||||
D3D11_SIT_UAV_APPEND_STRUCTURED = D3D_SIT_UAV_APPEND_STRUCTURED,
|
||||
D3D11_SIT_UAV_CONSUME_STRUCTURED = D3D_SIT_UAV_CONSUME_STRUCTURED,
|
||||
D3D11_SIT_UAV_RWSTRUCTURED_WITH_COUNTER = D3D_SIT_UAV_RWSTRUCTURED_WITH_COUNTER
|
||||
} D3D_SHADER_INPUT_TYPE;
|
||||
|
||||
typedef
|
||||
enum _D3D_SHADER_CBUFFER_FLAGS
|
||||
{
|
||||
D3D_CBF_USERPACKED = 1,
|
||||
D3D10_CBF_USERPACKED = D3D_CBF_USERPACKED,
|
||||
D3D_CBF_FORCE_DWORD = 0x7fffffff
|
||||
} D3D_SHADER_CBUFFER_FLAGS;
|
||||
|
||||
typedef
|
||||
enum _D3D_CBUFFER_TYPE
|
||||
{
|
||||
D3D_CT_CBUFFER = 0,
|
||||
D3D_CT_TBUFFER = ( D3D_CT_CBUFFER + 1 ) ,
|
||||
D3D_CT_INTERFACE_POINTERS = ( D3D_CT_TBUFFER + 1 ) ,
|
||||
D3D_CT_RESOURCE_BIND_INFO = ( D3D_CT_INTERFACE_POINTERS + 1 ) ,
|
||||
D3D10_CT_CBUFFER = D3D_CT_CBUFFER,
|
||||
D3D10_CT_TBUFFER = D3D_CT_TBUFFER,
|
||||
D3D11_CT_CBUFFER = D3D_CT_CBUFFER,
|
||||
D3D11_CT_TBUFFER = D3D_CT_TBUFFER,
|
||||
D3D11_CT_INTERFACE_POINTERS = D3D_CT_INTERFACE_POINTERS,
|
||||
D3D11_CT_RESOURCE_BIND_INFO = D3D_CT_RESOURCE_BIND_INFO
|
||||
} D3D_CBUFFER_TYPE;
|
||||
|
||||
typedef
|
||||
enum D3D_NAME
|
||||
{
|
||||
D3D_NAME_UNDEFINED = 0,
|
||||
D3D_NAME_POSITION = 1,
|
||||
D3D_NAME_CLIP_DISTANCE = 2,
|
||||
D3D_NAME_CULL_DISTANCE = 3,
|
||||
D3D_NAME_RENDER_TARGET_ARRAY_INDEX = 4,
|
||||
D3D_NAME_VIEWPORT_ARRAY_INDEX = 5,
|
||||
D3D_NAME_VERTEX_ID = 6,
|
||||
D3D_NAME_PRIMITIVE_ID = 7,
|
||||
D3D_NAME_INSTANCE_ID = 8,
|
||||
D3D_NAME_IS_FRONT_FACE = 9,
|
||||
D3D_NAME_SAMPLE_INDEX = 10,
|
||||
D3D_NAME_FINAL_QUAD_EDGE_TESSFACTOR = 11,
|
||||
D3D_NAME_FINAL_QUAD_INSIDE_TESSFACTOR = 12,
|
||||
D3D_NAME_FINAL_TRI_EDGE_TESSFACTOR = 13,
|
||||
D3D_NAME_FINAL_TRI_INSIDE_TESSFACTOR = 14,
|
||||
D3D_NAME_FINAL_LINE_DETAIL_TESSFACTOR = 15,
|
||||
D3D_NAME_FINAL_LINE_DENSITY_TESSFACTOR = 16,
|
||||
D3D_NAME_TARGET = 64,
|
||||
D3D_NAME_DEPTH = 65,
|
||||
D3D_NAME_COVERAGE = 66,
|
||||
D3D_NAME_DEPTH_GREATER_EQUAL = 67,
|
||||
D3D_NAME_DEPTH_LESS_EQUAL = 68,
|
||||
D3D10_NAME_UNDEFINED = D3D_NAME_UNDEFINED,
|
||||
D3D10_NAME_POSITION = D3D_NAME_POSITION,
|
||||
D3D10_NAME_CLIP_DISTANCE = D3D_NAME_CLIP_DISTANCE,
|
||||
D3D10_NAME_CULL_DISTANCE = D3D_NAME_CULL_DISTANCE,
|
||||
D3D10_NAME_RENDER_TARGET_ARRAY_INDEX = D3D_NAME_RENDER_TARGET_ARRAY_INDEX,
|
||||
D3D10_NAME_VIEWPORT_ARRAY_INDEX = D3D_NAME_VIEWPORT_ARRAY_INDEX,
|
||||
D3D10_NAME_VERTEX_ID = D3D_NAME_VERTEX_ID,
|
||||
D3D10_NAME_PRIMITIVE_ID = D3D_NAME_PRIMITIVE_ID,
|
||||
D3D10_NAME_INSTANCE_ID = D3D_NAME_INSTANCE_ID,
|
||||
D3D10_NAME_IS_FRONT_FACE = D3D_NAME_IS_FRONT_FACE,
|
||||
D3D10_NAME_SAMPLE_INDEX = D3D_NAME_SAMPLE_INDEX,
|
||||
D3D10_NAME_TARGET = D3D_NAME_TARGET,
|
||||
D3D10_NAME_DEPTH = D3D_NAME_DEPTH,
|
||||
D3D10_NAME_COVERAGE = D3D_NAME_COVERAGE,
|
||||
D3D11_NAME_FINAL_QUAD_EDGE_TESSFACTOR = D3D_NAME_FINAL_QUAD_EDGE_TESSFACTOR,
|
||||
D3D11_NAME_FINAL_QUAD_INSIDE_TESSFACTOR = D3D_NAME_FINAL_QUAD_INSIDE_TESSFACTOR,
|
||||
D3D11_NAME_FINAL_TRI_EDGE_TESSFACTOR = D3D_NAME_FINAL_TRI_EDGE_TESSFACTOR,
|
||||
D3D11_NAME_FINAL_TRI_INSIDE_TESSFACTOR = D3D_NAME_FINAL_TRI_INSIDE_TESSFACTOR,
|
||||
D3D11_NAME_FINAL_LINE_DETAIL_TESSFACTOR = D3D_NAME_FINAL_LINE_DETAIL_TESSFACTOR,
|
||||
D3D11_NAME_FINAL_LINE_DENSITY_TESSFACTOR = D3D_NAME_FINAL_LINE_DENSITY_TESSFACTOR,
|
||||
D3D11_NAME_DEPTH_GREATER_EQUAL = D3D_NAME_DEPTH_GREATER_EQUAL,
|
||||
D3D11_NAME_DEPTH_LESS_EQUAL = D3D_NAME_DEPTH_LESS_EQUAL
|
||||
} D3D_NAME;
|
||||
|
||||
typedef
|
||||
enum D3D_RESOURCE_RETURN_TYPE
|
||||
{
|
||||
D3D_RETURN_TYPE_UNORM = 1,
|
||||
D3D_RETURN_TYPE_SNORM = 2,
|
||||
D3D_RETURN_TYPE_SINT = 3,
|
||||
D3D_RETURN_TYPE_UINT = 4,
|
||||
D3D_RETURN_TYPE_FLOAT = 5,
|
||||
D3D_RETURN_TYPE_MIXED = 6,
|
||||
D3D_RETURN_TYPE_DOUBLE = 7,
|
||||
D3D_RETURN_TYPE_CONTINUED = 8,
|
||||
D3D10_RETURN_TYPE_UNORM = D3D_RETURN_TYPE_UNORM,
|
||||
D3D10_RETURN_TYPE_SNORM = D3D_RETURN_TYPE_SNORM,
|
||||
D3D10_RETURN_TYPE_SINT = D3D_RETURN_TYPE_SINT,
|
||||
D3D10_RETURN_TYPE_UINT = D3D_RETURN_TYPE_UINT,
|
||||
D3D10_RETURN_TYPE_FLOAT = D3D_RETURN_TYPE_FLOAT,
|
||||
D3D10_RETURN_TYPE_MIXED = D3D_RETURN_TYPE_MIXED,
|
||||
D3D11_RETURN_TYPE_UNORM = D3D_RETURN_TYPE_UNORM,
|
||||
D3D11_RETURN_TYPE_SNORM = D3D_RETURN_TYPE_SNORM,
|
||||
D3D11_RETURN_TYPE_SINT = D3D_RETURN_TYPE_SINT,
|
||||
D3D11_RETURN_TYPE_UINT = D3D_RETURN_TYPE_UINT,
|
||||
D3D11_RETURN_TYPE_FLOAT = D3D_RETURN_TYPE_FLOAT,
|
||||
D3D11_RETURN_TYPE_MIXED = D3D_RETURN_TYPE_MIXED,
|
||||
D3D11_RETURN_TYPE_DOUBLE = D3D_RETURN_TYPE_DOUBLE,
|
||||
D3D11_RETURN_TYPE_CONTINUED = D3D_RETURN_TYPE_CONTINUED
|
||||
} D3D_RESOURCE_RETURN_TYPE;
|
||||
|
||||
typedef
|
||||
enum D3D_REGISTER_COMPONENT_TYPE
|
||||
{
|
||||
D3D_REGISTER_COMPONENT_UNKNOWN = 0,
|
||||
D3D_REGISTER_COMPONENT_UINT32 = 1,
|
||||
D3D_REGISTER_COMPONENT_SINT32 = 2,
|
||||
D3D_REGISTER_COMPONENT_FLOAT32 = 3,
|
||||
D3D10_REGISTER_COMPONENT_UNKNOWN = D3D_REGISTER_COMPONENT_UNKNOWN,
|
||||
D3D10_REGISTER_COMPONENT_UINT32 = D3D_REGISTER_COMPONENT_UINT32,
|
||||
D3D10_REGISTER_COMPONENT_SINT32 = D3D_REGISTER_COMPONENT_SINT32,
|
||||
D3D10_REGISTER_COMPONENT_FLOAT32 = D3D_REGISTER_COMPONENT_FLOAT32
|
||||
} D3D_REGISTER_COMPONENT_TYPE;
|
||||
|
||||
typedef
|
||||
enum D3D_TESSELLATOR_DOMAIN
|
||||
{
|
||||
D3D_TESSELLATOR_DOMAIN_UNDEFINED = 0,
|
||||
D3D_TESSELLATOR_DOMAIN_ISOLINE = 1,
|
||||
D3D_TESSELLATOR_DOMAIN_TRI = 2,
|
||||
D3D_TESSELLATOR_DOMAIN_QUAD = 3,
|
||||
D3D11_TESSELLATOR_DOMAIN_UNDEFINED = D3D_TESSELLATOR_DOMAIN_UNDEFINED,
|
||||
D3D11_TESSELLATOR_DOMAIN_ISOLINE = D3D_TESSELLATOR_DOMAIN_ISOLINE,
|
||||
D3D11_TESSELLATOR_DOMAIN_TRI = D3D_TESSELLATOR_DOMAIN_TRI,
|
||||
D3D11_TESSELLATOR_DOMAIN_QUAD = D3D_TESSELLATOR_DOMAIN_QUAD
|
||||
} D3D_TESSELLATOR_DOMAIN;
|
||||
|
||||
typedef
|
||||
enum D3D_TESSELLATOR_PARTITIONING
|
||||
{
|
||||
D3D_TESSELLATOR_PARTITIONING_UNDEFINED = 0,
|
||||
D3D_TESSELLATOR_PARTITIONING_INTEGER = 1,
|
||||
D3D_TESSELLATOR_PARTITIONING_POW2 = 2,
|
||||
D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD = 3,
|
||||
D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN = 4,
|
||||
D3D11_TESSELLATOR_PARTITIONING_UNDEFINED = D3D_TESSELLATOR_PARTITIONING_UNDEFINED,
|
||||
D3D11_TESSELLATOR_PARTITIONING_INTEGER = D3D_TESSELLATOR_PARTITIONING_INTEGER,
|
||||
D3D11_TESSELLATOR_PARTITIONING_POW2 = D3D_TESSELLATOR_PARTITIONING_POW2,
|
||||
D3D11_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD = D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD,
|
||||
D3D11_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN = D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN
|
||||
} D3D_TESSELLATOR_PARTITIONING;
|
||||
|
||||
typedef
|
||||
enum D3D_TESSELLATOR_OUTPUT_PRIMITIVE
|
||||
{
|
||||
D3D_TESSELLATOR_OUTPUT_UNDEFINED = 0,
|
||||
D3D_TESSELLATOR_OUTPUT_POINT = 1,
|
||||
D3D_TESSELLATOR_OUTPUT_LINE = 2,
|
||||
D3D_TESSELLATOR_OUTPUT_TRIANGLE_CW = 3,
|
||||
D3D_TESSELLATOR_OUTPUT_TRIANGLE_CCW = 4,
|
||||
D3D11_TESSELLATOR_OUTPUT_UNDEFINED = D3D_TESSELLATOR_OUTPUT_UNDEFINED,
|
||||
D3D11_TESSELLATOR_OUTPUT_POINT = D3D_TESSELLATOR_OUTPUT_POINT,
|
||||
D3D11_TESSELLATOR_OUTPUT_LINE = D3D_TESSELLATOR_OUTPUT_LINE,
|
||||
D3D11_TESSELLATOR_OUTPUT_TRIANGLE_CW = D3D_TESSELLATOR_OUTPUT_TRIANGLE_CW,
|
||||
D3D11_TESSELLATOR_OUTPUT_TRIANGLE_CCW = D3D_TESSELLATOR_OUTPUT_TRIANGLE_CCW
|
||||
} D3D_TESSELLATOR_OUTPUT_PRIMITIVE;
|
||||
|
||||
typedef
|
||||
enum D3D_MIN_PRECISION
|
||||
{
|
||||
D3D_MIN_PRECISION_DEFAULT = 0,
|
||||
D3D_MIN_PRECISION_FLOAT_16 = 1,
|
||||
D3D_MIN_PRECISION_FLOAT_2_8 = 2,
|
||||
D3D_MIN_PRECISION_RESERVED = 3,
|
||||
D3D_MIN_PRECISION_SINT_16 = 4,
|
||||
D3D_MIN_PRECISION_UINT_16 = 5,
|
||||
D3D_MIN_PRECISION_ANY_16 = 0xf0,
|
||||
D3D_MIN_PRECISION_ANY_10 = 0xf1
|
||||
} D3D_MIN_PRECISION;
|
||||
|
||||
DEFINE_GUID(WKPDID_D3DDebugObjectName,0x429b8c22,0x9188,0x4b0c,0x87,0x42,0xac,0xb0,0xbf,0x85,0xc2,0x00);
|
||||
#define D3D_SET_OBJECT_NAME_N_A(pObject, Chars, pName) (pObject)->SetPrivateData(WKPDID_D3DDebugObjectName, Chars, pName)
|
||||
#define D3D_SET_OBJECT_NAME_A(pObject, pName) D3D_SET_OBJECT_NAME_N_A(pObject, lstrlenA(pName), pName)
|
||||
|
||||
|
||||
extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0001_v0_0_c_ifspec;
|
||||
extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0001_v0_0_s_ifspec;
|
||||
|
||||
/* Additional Prototypes for ALL interfaces */
|
||||
|
||||
/* end of Additional Prototypes */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,538 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// File: D3DCompiler.h
|
||||
// Content: D3D Compilation Types and APIs
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __D3DCOMPILER_H__
|
||||
#define __D3DCOMPILER_H__
|
||||
|
||||
#include <winapifamily.h>
|
||||
|
||||
#pragma region Application Family
|
||||
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
|
||||
|
||||
// Current name of the DLL shipped in the same SDK as this header.
|
||||
|
||||
|
||||
#define D3DCOMPILER_DLL_W L"d3dcompiler_46.dll"
|
||||
#define D3DCOMPILER_DLL_A "d3dcompiler_46.dll"
|
||||
|
||||
// Current HLSL compiler version.
|
||||
|
||||
#define D3D_COMPILER_VERSION 46
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DCOMPILER_DLL D3DCOMPILER_DLL_W
|
||||
#else
|
||||
#define D3DCOMPILER_DLL D3DCOMPILER_DLL_A
|
||||
#endif
|
||||
|
||||
#include "d3d11shader.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// APIs //////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
|
||||
#pragma endregion
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif //__cplusplus
|
||||
|
||||
#pragma region Application Family
|
||||
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DReadFileToBlob:
|
||||
// -----------------
|
||||
// Simple helper routine to read a file on disk into memory
|
||||
// for passing to other routines in this API.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DReadFileToBlob(_In_ LPCWSTR pFileName,
|
||||
_Out_ ID3DBlob** ppContents);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DWriteBlobToFile:
|
||||
// ------------------
|
||||
// Simple helper routine to write a memory blob to a file on disk.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DWriteBlobToFile(_In_ ID3DBlob* pBlob,
|
||||
_In_ LPCWSTR pFileName,
|
||||
_In_ BOOL bOverwrite);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DCOMPILE flags:
|
||||
// -----------------
|
||||
// D3DCOMPILE_DEBUG
|
||||
// Insert debug file/line/type/symbol information.
|
||||
//
|
||||
// D3DCOMPILE_SKIP_VALIDATION
|
||||
// Do not validate the generated code against known capabilities and
|
||||
// constraints. This option is only recommended when compiling shaders
|
||||
// you KNOW will work. (ie. have compiled before without this option.)
|
||||
// Shaders are always validated by D3D before they are set to the device.
|
||||
//
|
||||
// D3DCOMPILE_SKIP_OPTIMIZATION
|
||||
// Instructs the compiler to skip optimization steps during code generation.
|
||||
// Unless you are trying to isolate a problem in your code using this option
|
||||
// is not recommended.
|
||||
//
|
||||
// D3DCOMPILE_PACK_MATRIX_ROW_MAJOR
|
||||
// Unless explicitly specified, matrices will be packed in row-major order
|
||||
// on input and output from the shader.
|
||||
//
|
||||
// D3DCOMPILE_PACK_MATRIX_COLUMN_MAJOR
|
||||
// Unless explicitly specified, matrices will be packed in column-major
|
||||
// order on input and output from the shader. This is generally more
|
||||
// efficient, since it allows vector-matrix multiplication to be performed
|
||||
// using a series of dot-products.
|
||||
//
|
||||
// D3DCOMPILE_PARTIAL_PRECISION
|
||||
// Force all computations in resulting shader to occur at partial precision.
|
||||
// This may result in faster evaluation of shaders on some hardware.
|
||||
//
|
||||
// D3DCOMPILE_FORCE_VS_SOFTWARE_NO_OPT
|
||||
// Force compiler to compile against the next highest available software
|
||||
// target for vertex shaders. This flag also turns optimizations off,
|
||||
// and debugging on.
|
||||
//
|
||||
// D3DCOMPILE_FORCE_PS_SOFTWARE_NO_OPT
|
||||
// Force compiler to compile against the next highest available software
|
||||
// target for pixel shaders. This flag also turns optimizations off,
|
||||
// and debugging on.
|
||||
//
|
||||
// D3DCOMPILE_NO_PRESHADER
|
||||
// Disables Preshaders. Using this flag will cause the compiler to not
|
||||
// pull out static expression for evaluation on the host cpu
|
||||
//
|
||||
// D3DCOMPILE_AVOID_FLOW_CONTROL
|
||||
// Hint compiler to avoid flow-control constructs where possible.
|
||||
//
|
||||
// D3DCOMPILE_PREFER_FLOW_CONTROL
|
||||
// Hint compiler to prefer flow-control constructs where possible.
|
||||
//
|
||||
// D3DCOMPILE_ENABLE_STRICTNESS
|
||||
// By default, the HLSL/Effect compilers are not strict on deprecated syntax.
|
||||
// Specifying this flag enables the strict mode. Deprecated syntax may be
|
||||
// removed in a future release, and enabling syntax is a good way to make
|
||||
// sure your shaders comply to the latest spec.
|
||||
//
|
||||
// D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY
|
||||
// This enables older shaders to compile to 4_0 targets.
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
#define D3DCOMPILE_DEBUG (1 << 0)
|
||||
#define D3DCOMPILE_SKIP_VALIDATION (1 << 1)
|
||||
#define D3DCOMPILE_SKIP_OPTIMIZATION (1 << 2)
|
||||
#define D3DCOMPILE_PACK_MATRIX_ROW_MAJOR (1 << 3)
|
||||
#define D3DCOMPILE_PACK_MATRIX_COLUMN_MAJOR (1 << 4)
|
||||
#define D3DCOMPILE_PARTIAL_PRECISION (1 << 5)
|
||||
#define D3DCOMPILE_FORCE_VS_SOFTWARE_NO_OPT (1 << 6)
|
||||
#define D3DCOMPILE_FORCE_PS_SOFTWARE_NO_OPT (1 << 7)
|
||||
#define D3DCOMPILE_NO_PRESHADER (1 << 8)
|
||||
#define D3DCOMPILE_AVOID_FLOW_CONTROL (1 << 9)
|
||||
#define D3DCOMPILE_PREFER_FLOW_CONTROL (1 << 10)
|
||||
#define D3DCOMPILE_ENABLE_STRICTNESS (1 << 11)
|
||||
#define D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY (1 << 12)
|
||||
#define D3DCOMPILE_IEEE_STRICTNESS (1 << 13)
|
||||
#define D3DCOMPILE_OPTIMIZATION_LEVEL0 (1 << 14)
|
||||
#define D3DCOMPILE_OPTIMIZATION_LEVEL1 0
|
||||
#define D3DCOMPILE_OPTIMIZATION_LEVEL2 ((1 << 14) | (1 << 15))
|
||||
#define D3DCOMPILE_OPTIMIZATION_LEVEL3 (1 << 15)
|
||||
#define D3DCOMPILE_RESERVED16 (1 << 16)
|
||||
#define D3DCOMPILE_RESERVED17 (1 << 17)
|
||||
#define D3DCOMPILE_WARNINGS_ARE_ERRORS (1 << 18)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DCOMPILE_EFFECT flags:
|
||||
// -------------------------------------
|
||||
// These flags are passed in when creating an effect, and affect
|
||||
// either compilation behavior or runtime effect behavior
|
||||
//
|
||||
// D3DCOMPILE_EFFECT_CHILD_EFFECT
|
||||
// Compile this .fx file to a child effect. Child effects have no
|
||||
// initializers for any shared values as these are initialied in the
|
||||
// master effect (pool).
|
||||
//
|
||||
// D3DCOMPILE_EFFECT_ALLOW_SLOW_OPS
|
||||
// By default, performance mode is enabled. Performance mode
|
||||
// disallows mutable state objects by preventing non-literal
|
||||
// expressions from appearing in state object definitions.
|
||||
// Specifying this flag will disable the mode and allow for mutable
|
||||
// state objects.
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
#define D3DCOMPILE_EFFECT_CHILD_EFFECT (1 << 0)
|
||||
#define D3DCOMPILE_EFFECT_ALLOW_SLOW_OPS (1 << 1)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DCompile:
|
||||
// ----------
|
||||
// Compile source text into bytecode appropriate for the given target.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
// D3D_COMPILE_STANDARD_FILE_INCLUDE can be passed for pInclude in any
|
||||
// API and indicates that a simple default include handler should be
|
||||
// used. The include handler will include files relative to the
|
||||
// current directory and files relative to the directory of the initial source
|
||||
// file. When used with APIs like D3DCompile pSourceName must be a
|
||||
// file name and the initial relative directory will be derived from it.
|
||||
#define D3D_COMPILE_STANDARD_FILE_INCLUDE ((ID3DInclude*)(UINT_PTR)1)
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DCompile(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
|
||||
_In_ SIZE_T SrcDataSize,
|
||||
_In_opt_ LPCSTR pSourceName,
|
||||
_In_reads_opt_(_Inexpressible_(pDefines->Name != NULL)) CONST D3D_SHADER_MACRO* pDefines,
|
||||
_In_opt_ ID3DInclude* pInclude,
|
||||
_In_ LPCSTR pEntrypoint,
|
||||
_In_ LPCSTR pTarget,
|
||||
_In_ UINT Flags1,
|
||||
_In_ UINT Flags2,
|
||||
_Out_ ID3DBlob** ppCode,
|
||||
_Out_opt_ ID3DBlob** ppErrorMsgs);
|
||||
|
||||
typedef HRESULT (WINAPI *pD3DCompile)
|
||||
(LPCVOID pSrcData,
|
||||
SIZE_T SrcDataSize,
|
||||
LPCSTR pFileName,
|
||||
CONST D3D_SHADER_MACRO* pDefines,
|
||||
ID3DInclude* pInclude,
|
||||
LPCSTR pEntrypoint,
|
||||
LPCSTR pTarget,
|
||||
UINT Flags1,
|
||||
UINT Flags2,
|
||||
ID3DBlob** ppCode,
|
||||
ID3DBlob** ppErrorMsgs);
|
||||
|
||||
#define D3DCOMPILE_SECDATA_MERGE_UAV_SLOTS 0x00000001
|
||||
#define D3DCOMPILE_SECDATA_PRESERVE_TEMPLATE_SLOTS 0x00000002
|
||||
#define D3DCOMPILE_SECDATA_REQUIRE_TEMPLATE_MATCH 0x00000004
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DCompile2(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
|
||||
_In_ SIZE_T SrcDataSize,
|
||||
_In_opt_ LPCSTR pSourceName,
|
||||
_In_reads_opt_(_Inexpressible_(pDefines->Name != NULL)) CONST D3D_SHADER_MACRO* pDefines,
|
||||
_In_opt_ ID3DInclude* pInclude,
|
||||
_In_ LPCSTR pEntrypoint,
|
||||
_In_ LPCSTR pTarget,
|
||||
_In_ UINT Flags1,
|
||||
_In_ UINT Flags2,
|
||||
_In_ UINT SecondaryDataFlags,
|
||||
_In_reads_bytes_opt_(SecondaryDataSize) LPCVOID pSecondaryData,
|
||||
_In_ SIZE_T SecondaryDataSize,
|
||||
_Out_ ID3DBlob** ppCode,
|
||||
_Out_opt_ ID3DBlob** ppErrorMsgs);
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DCompileFromFile(_In_ LPCWSTR pFileName,
|
||||
_In_reads_opt_(_Inexpressible_(pDefines->Name != NULL)) CONST D3D_SHADER_MACRO* pDefines,
|
||||
_In_opt_ ID3DInclude* pInclude,
|
||||
_In_ LPCSTR pEntrypoint,
|
||||
_In_ LPCSTR pTarget,
|
||||
_In_ UINT Flags1,
|
||||
_In_ UINT Flags2,
|
||||
_Out_ ID3DBlob** ppCode,
|
||||
_Out_opt_ ID3DBlob** ppErrorMsgs);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DPreprocess:
|
||||
// -------------
|
||||
// Process source text with the compiler's preprocessor and return
|
||||
// the resulting text.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DPreprocess(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
|
||||
_In_ SIZE_T SrcDataSize,
|
||||
_In_opt_ LPCSTR pSourceName,
|
||||
_In_opt_ CONST D3D_SHADER_MACRO* pDefines,
|
||||
_In_opt_ ID3DInclude* pInclude,
|
||||
_Out_ ID3DBlob** ppCodeText,
|
||||
_Out_opt_ ID3DBlob** ppErrorMsgs);
|
||||
|
||||
typedef HRESULT (WINAPI *pD3DPreprocess)
|
||||
(LPCVOID pSrcData,
|
||||
SIZE_T SrcDataSize,
|
||||
LPCSTR pFileName,
|
||||
CONST D3D_SHADER_MACRO* pDefines,
|
||||
ID3DInclude* pInclude,
|
||||
ID3DBlob** ppCodeText,
|
||||
ID3DBlob** ppErrorMsgs);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DGetDebugInfo:
|
||||
// -----------------------
|
||||
// Gets shader debug info. Debug info is generated by D3DCompile and is
|
||||
// embedded in the body of the shader.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DGetDebugInfo(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
|
||||
_In_ SIZE_T SrcDataSize,
|
||||
_Out_ ID3DBlob** ppDebugInfo);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DReflect:
|
||||
// ----------
|
||||
// Shader code contains metadata that can be inspected via the
|
||||
// reflection APIs.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DReflect(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
|
||||
_In_ SIZE_T SrcDataSize,
|
||||
_In_ REFIID pInterface,
|
||||
_Out_ void** ppReflector);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DDisassemble:
|
||||
// ----------------------
|
||||
// Takes a binary shader and returns a buffer containing text assembly.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
#define D3D_DISASM_ENABLE_COLOR_CODE 0x00000001
|
||||
#define D3D_DISASM_ENABLE_DEFAULT_VALUE_PRINTS 0x00000002
|
||||
#define D3D_DISASM_ENABLE_INSTRUCTION_NUMBERING 0x00000004
|
||||
#define D3D_DISASM_ENABLE_INSTRUCTION_CYCLE 0x00000008
|
||||
#define D3D_DISASM_DISABLE_DEBUG_INFO 0x00000010
|
||||
#define D3D_DISASM_ENABLE_INSTRUCTION_OFFSET 0x00000020
|
||||
#define D3D_DISASM_INSTRUCTION_ONLY 0x00000040
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DDisassemble(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
|
||||
_In_ SIZE_T SrcDataSize,
|
||||
_In_ UINT Flags,
|
||||
_In_opt_ LPCSTR szComments,
|
||||
_Out_ ID3DBlob** ppDisassembly);
|
||||
|
||||
typedef HRESULT (WINAPI *pD3DDisassemble)
|
||||
(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
|
||||
_In_ SIZE_T SrcDataSize,
|
||||
_In_ UINT Flags,
|
||||
_In_opt_ LPCSTR szComments,
|
||||
_Out_ ID3DBlob** ppDisassembly);
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DDisassembleRegion(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
|
||||
_In_ SIZE_T SrcDataSize,
|
||||
_In_ UINT Flags,
|
||||
_In_opt_ LPCSTR szComments,
|
||||
_In_ SIZE_T StartByteOffset,
|
||||
_In_ SIZE_T NumInsts,
|
||||
_Out_opt_ SIZE_T* pFinishByteOffset,
|
||||
_Out_ ID3DBlob** ppDisassembly);
|
||||
|
||||
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
|
||||
#pragma endregion
|
||||
|
||||
#pragma region Desktop Family
|
||||
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DDisassemble10Effect:
|
||||
// -----------------------
|
||||
// Takes a D3D10 effect interface and returns a
|
||||
// buffer containing text assembly.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DDisassemble10Effect(_In_ interface ID3D10Effect *pEffect,
|
||||
_In_ UINT Flags,
|
||||
_Out_ ID3DBlob** ppDisassembly);
|
||||
|
||||
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
|
||||
#pragma endregion
|
||||
|
||||
#pragma region Application Family
|
||||
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DGetTraceInstructionOffsets:
|
||||
// -----------------------
|
||||
// Determines byte offsets for instructions within a shader blob.
|
||||
// This information is useful for going between trace instruction
|
||||
// indices and byte offsets that are used in debug information.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
#define D3D_GET_INST_OFFSETS_INCLUDE_NON_EXECUTABLE 0x00000001
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DGetTraceInstructionOffsets(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
|
||||
_In_ SIZE_T SrcDataSize,
|
||||
_In_ UINT Flags,
|
||||
_In_ SIZE_T StartInstIndex,
|
||||
_In_ SIZE_T NumInsts,
|
||||
_Out_writes_to_opt_(NumInsts, min(NumInsts, *pTotalInsts)) SIZE_T* pOffsets,
|
||||
_Out_opt_ SIZE_T* pTotalInsts);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DGetInputSignatureBlob:
|
||||
// -----------------------
|
||||
// Retrieve the input signature from a compilation result.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DGetInputSignatureBlob(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
|
||||
_In_ SIZE_T SrcDataSize,
|
||||
_Out_ ID3DBlob** ppSignatureBlob);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DGetOutputSignatureBlob:
|
||||
// -----------------------
|
||||
// Retrieve the output signature from a compilation result.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DGetOutputSignatureBlob(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
|
||||
_In_ SIZE_T SrcDataSize,
|
||||
_Out_ ID3DBlob** ppSignatureBlob);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DGetInputAndOutputSignatureBlob:
|
||||
// -----------------------
|
||||
// Retrieve the input and output signatures from a compilation result.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DGetInputAndOutputSignatureBlob(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
|
||||
_In_ SIZE_T SrcDataSize,
|
||||
_Out_ ID3DBlob** ppSignatureBlob);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DStripShader:
|
||||
// -----------------------
|
||||
// Removes unwanted blobs from a compilation result
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
typedef enum D3DCOMPILER_STRIP_FLAGS
|
||||
{
|
||||
D3DCOMPILER_STRIP_REFLECTION_DATA = 1,
|
||||
D3DCOMPILER_STRIP_DEBUG_INFO = 2,
|
||||
D3DCOMPILER_STRIP_TEST_BLOBS = 4,
|
||||
D3DCOMPILER_STRIP_PRIVATE_DATA = 8,
|
||||
D3DCOMPILER_STRIP_FORCE_DWORD = 0x7fffffff,
|
||||
} D3DCOMPILER_STRIP_FLAGS;
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DStripShader(_In_reads_bytes_(BytecodeLength) LPCVOID pShaderBytecode,
|
||||
_In_ SIZE_T BytecodeLength,
|
||||
_In_ UINT uStripFlags,
|
||||
_Out_ ID3DBlob** ppStrippedBlob);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DGetBlobPart:
|
||||
// -----------------------
|
||||
// Extracts information from a compilation result.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
typedef enum D3D_BLOB_PART
|
||||
{
|
||||
D3D_BLOB_INPUT_SIGNATURE_BLOB,
|
||||
D3D_BLOB_OUTPUT_SIGNATURE_BLOB,
|
||||
D3D_BLOB_INPUT_AND_OUTPUT_SIGNATURE_BLOB,
|
||||
D3D_BLOB_PATCH_CONSTANT_SIGNATURE_BLOB,
|
||||
D3D_BLOB_ALL_SIGNATURE_BLOB,
|
||||
D3D_BLOB_DEBUG_INFO,
|
||||
D3D_BLOB_LEGACY_SHADER,
|
||||
D3D_BLOB_XNA_PREPASS_SHADER,
|
||||
D3D_BLOB_XNA_SHADER,
|
||||
D3D_BLOB_PDB,
|
||||
D3D_BLOB_PRIVATE_DATA,
|
||||
|
||||
// Test parts are only produced by special compiler versions and so
|
||||
// are usually not present in shaders.
|
||||
D3D_BLOB_TEST_ALTERNATE_SHADER = 0x8000,
|
||||
D3D_BLOB_TEST_COMPILE_DETAILS,
|
||||
D3D_BLOB_TEST_COMPILE_PERF,
|
||||
D3D_BLOB_TEST_COMPILE_REPORT,
|
||||
} D3D_BLOB_PART;
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DGetBlobPart(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
|
||||
_In_ SIZE_T SrcDataSize,
|
||||
_In_ D3D_BLOB_PART Part,
|
||||
_In_ UINT Flags,
|
||||
_Out_ ID3DBlob** ppPart);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DSetBlobPart:
|
||||
// -----------------------
|
||||
// Update information in a compilation result.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DSetBlobPart(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
|
||||
_In_ SIZE_T SrcDataSize,
|
||||
_In_ D3D_BLOB_PART Part,
|
||||
_In_ UINT Flags,
|
||||
_In_reads_bytes_(PartSize) LPCVOID pPart,
|
||||
_In_ SIZE_T PartSize,
|
||||
_Out_ ID3DBlob** ppNewShader);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DCompressShaders:
|
||||
// -----------------------
|
||||
// Compresses a set of shaders into a more compact form.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
typedef struct _D3D_SHADER_DATA
|
||||
{
|
||||
LPCVOID pBytecode;
|
||||
SIZE_T BytecodeLength;
|
||||
} D3D_SHADER_DATA;
|
||||
|
||||
#define D3D_COMPRESS_SHADER_KEEP_ALL_PARTS 0x00000001
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DCompressShaders(_In_ UINT uNumShaders,
|
||||
_In_reads_(uNumShaders) D3D_SHADER_DATA* pShaderData,
|
||||
_In_ UINT uFlags,
|
||||
_Out_ ID3DBlob** ppCompressedData);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DDecompressShaders:
|
||||
// -----------------------
|
||||
// Decompresses one or more shaders from a compressed set.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DDecompressShaders(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
|
||||
_In_ SIZE_T SrcDataSize,
|
||||
_In_ UINT uNumShaders,
|
||||
_In_ UINT uStartIndex,
|
||||
_In_reads_opt_(uNumShaders) UINT* pIndices,
|
||||
_In_ UINT uFlags,
|
||||
_Out_writes_(uNumShaders) ID3DBlob** ppShaders,
|
||||
_Out_opt_ UINT* pTotalShaders);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DCreateBlob:
|
||||
// -----------------------
|
||||
// Create an ID3DBlob instance.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DCreateBlob(_In_ SIZE_T Size,
|
||||
_Out_ ID3DBlob** ppBlob);
|
||||
|
||||
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
|
||||
#pragma endregion
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif //__cplusplus
|
||||
|
||||
#endif // #ifndef __D3DCOMPILER_H__
|
||||
2951
hgplus/las/framework-dx11-nasm/tools/headerGenerator/dxgi.h
Normal file
2951
hgplus/las/framework-dx11-nasm/tools/headerGenerator/dxgi.h
Normal file
File diff suppressed because it is too large
Load Diff
457
hgplus/las/framework-dx11-nasm/tools/headerGenerator/dxgi.inc
Normal file
457
hgplus/las/framework-dx11-nasm/tools/headerGenerator/dxgi.inc
Normal file
@@ -0,0 +1,457 @@
|
||||
; dxgi.inc by las/mercury
|
||||
|
||||
struc DXGI_SWAP_CHAIN_DESC
|
||||
; DXGI_MODE_DESC BufferDesc
|
||||
.Width: resd 1
|
||||
.Height: resd 1
|
||||
|
||||
; DXGI_RATIONAL RefreshRate
|
||||
.Numerator: resd 1
|
||||
.Denominator: resd 1
|
||||
|
||||
.Format: resd 1
|
||||
.ScanlineOrdering: resd 1
|
||||
.Scaling: resd 1
|
||||
|
||||
; DXGI_SAMPLE_DESC SampleDesc
|
||||
.Count: resd 1
|
||||
.Quality: resd 1
|
||||
|
||||
.BufferUsage: resd 1
|
||||
.BufferCount: resd 1
|
||||
.OutputWindow: resd 1
|
||||
.Windowed: resd 1
|
||||
.SwapEffect: resd 1
|
||||
.Flags: resd 1
|
||||
endstruc
|
||||
|
||||
; DXGI_RESIDENCY
|
||||
%define DXGI_RESIDENCY_FULLY_RESIDENT 1
|
||||
%define DXGI_RESIDENCY_RESIDENT_IN_SHARED_MEMORY 2
|
||||
%define DXGI_RESIDENCY_EVICTED_TO_DISK 3
|
||||
|
||||
; DXGI_SWAP_EFFECT
|
||||
%define DXGI_SWAP_EFFECT_DISCARD 0
|
||||
%define DXGI_SWAP_EFFECT_SEQUENTIAL 1
|
||||
%define DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL 3
|
||||
|
||||
; DXGI_SWAP_CHAIN_FLAG
|
||||
%define DXGI_SWAP_CHAIN_FLAG_NONPREROTATED 1
|
||||
%define DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH 2
|
||||
%define DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE 4
|
||||
%define DXGI_SWAP_CHAIN_FLAG_RESTRICTED_CONTENT 8
|
||||
%define DXGI_SWAP_CHAIN_FLAG_RESTRICT_SHARED_RESOURCE_DRIVER 16
|
||||
%define DXGI_SWAP_CHAIN_FLAG_DISPLAY_ONLY 32
|
||||
%define DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT 64
|
||||
%define DXGI_SWAP_CHAIN_FLAG_FOREGROUND_LAYER 128
|
||||
%define DXGI_SWAP_CHAIN_FLAG_FULLSCREEN_VIDEO 256
|
||||
|
||||
; DXGI_ADAPTER_FLAG
|
||||
%define DXGI_ADAPTER_FLAG_NONE 0
|
||||
%define DXGI_ADAPTER_FLAG_REMOTE 1
|
||||
%define DXGI_ADAPTER_FLAG_SOFTWARE 2
|
||||
%define DXGI_ADAPTER_FLAG_FORCE_DWORD 0xffffffff
|
||||
|
||||
; DXGI_FORMAT
|
||||
%define DXGI_FORMAT_UNKNOWN 0
|
||||
%define DXGI_FORMAT_R32G32B32A32_TYPELESS 1
|
||||
%define DXGI_FORMAT_R32G32B32A32_FLOAT 2
|
||||
%define DXGI_FORMAT_R32G32B32A32_UINT 3
|
||||
%define DXGI_FORMAT_R32G32B32A32_SINT 4
|
||||
%define DXGI_FORMAT_R32G32B32_TYPELESS 5
|
||||
%define DXGI_FORMAT_R32G32B32_FLOAT 6
|
||||
%define DXGI_FORMAT_R32G32B32_UINT 7
|
||||
%define DXGI_FORMAT_R32G32B32_SINT 8
|
||||
%define DXGI_FORMAT_R16G16B16A16_TYPELESS 9
|
||||
%define DXGI_FORMAT_R16G16B16A16_FLOAT 10
|
||||
%define DXGI_FORMAT_R16G16B16A16_UNORM 11
|
||||
%define DXGI_FORMAT_R16G16B16A16_UINT 12
|
||||
%define DXGI_FORMAT_R16G16B16A16_SNORM 13
|
||||
%define DXGI_FORMAT_R16G16B16A16_SINT 14
|
||||
%define DXGI_FORMAT_R32G32_TYPELESS 15
|
||||
%define DXGI_FORMAT_R32G32_FLOAT 16
|
||||
%define DXGI_FORMAT_R32G32_UINT 17
|
||||
%define DXGI_FORMAT_R32G32_SINT 18
|
||||
%define DXGI_FORMAT_R32G8X24_TYPELESS 19
|
||||
%define DXGI_FORMAT_D32_FLOAT_S8X24_UINT 20
|
||||
%define DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS 21
|
||||
%define DXGI_FORMAT_X32_TYPELESS_G8X24_UINT 22
|
||||
%define DXGI_FORMAT_R10G10B10A2_TYPELESS 23
|
||||
%define DXGI_FORMAT_R10G10B10A2_UNORM 24
|
||||
%define DXGI_FORMAT_R10G10B10A2_UINT 25
|
||||
%define DXGI_FORMAT_R11G11B10_FLOAT 26
|
||||
%define DXGI_FORMAT_R8G8B8A8_TYPELESS 27
|
||||
%define DXGI_FORMAT_R8G8B8A8_UNORM 28
|
||||
%define DXGI_FORMAT_R8G8B8A8_UNORM_SRGB 29
|
||||
%define DXGI_FORMAT_R8G8B8A8_UINT 30
|
||||
%define DXGI_FORMAT_R8G8B8A8_SNORM 31
|
||||
%define DXGI_FORMAT_R8G8B8A8_SINT 32
|
||||
%define DXGI_FORMAT_R16G16_TYPELESS 33
|
||||
%define DXGI_FORMAT_R16G16_FLOAT 34
|
||||
%define DXGI_FORMAT_R16G16_UNORM 35
|
||||
%define DXGI_FORMAT_R16G16_UINT 36
|
||||
%define DXGI_FORMAT_R16G16_SNORM 37
|
||||
%define DXGI_FORMAT_R16G16_SINT 38
|
||||
%define DXGI_FORMAT_R32_TYPELESS 39
|
||||
%define DXGI_FORMAT_D32_FLOAT 40
|
||||
%define DXGI_FORMAT_R32_FLOAT 41
|
||||
%define DXGI_FORMAT_R32_UINT 42
|
||||
%define DXGI_FORMAT_R32_SINT 43
|
||||
%define DXGI_FORMAT_R24G8_TYPELESS 44
|
||||
%define DXGI_FORMAT_D24_UNORM_S8_UINT 45
|
||||
%define DXGI_FORMAT_R24_UNORM_X8_TYPELESS 46
|
||||
%define DXGI_FORMAT_X24_TYPELESS_G8_UINT 47
|
||||
%define DXGI_FORMAT_R8G8_TYPELESS 48
|
||||
%define DXGI_FORMAT_R8G8_UNORM 49
|
||||
%define DXGI_FORMAT_R8G8_UINT 50
|
||||
%define DXGI_FORMAT_R8G8_SNORM 51
|
||||
%define DXGI_FORMAT_R8G8_SINT 52
|
||||
%define DXGI_FORMAT_R16_TYPELESS 53
|
||||
%define DXGI_FORMAT_R16_FLOAT 54
|
||||
%define DXGI_FORMAT_D16_UNORM 55
|
||||
%define DXGI_FORMAT_R16_UNORM 56
|
||||
%define DXGI_FORMAT_R16_UINT 57
|
||||
%define DXGI_FORMAT_R16_SNORM 58
|
||||
%define DXGI_FORMAT_R16_SINT 59
|
||||
%define DXGI_FORMAT_R8_TYPELESS 60
|
||||
%define DXGI_FORMAT_R8_UNORM 61
|
||||
%define DXGI_FORMAT_R8_UINT 62
|
||||
%define DXGI_FORMAT_R8_SNORM 63
|
||||
%define DXGI_FORMAT_R8_SINT 64
|
||||
%define DXGI_FORMAT_A8_UNORM 65
|
||||
%define DXGI_FORMAT_R1_UNORM 66
|
||||
%define DXGI_FORMAT_R9G9B9E5_SHAREDEXP 67
|
||||
%define DXGI_FORMAT_R8G8_B8G8_UNORM 68
|
||||
%define DXGI_FORMAT_G8R8_G8B8_UNORM 69
|
||||
%define DXGI_FORMAT_BC1_TYPELESS 70
|
||||
%define DXGI_FORMAT_BC1_UNORM 71
|
||||
%define DXGI_FORMAT_BC1_UNORM_SRGB 72
|
||||
%define DXGI_FORMAT_BC2_TYPELESS 73
|
||||
%define DXGI_FORMAT_BC2_UNORM 74
|
||||
%define DXGI_FORMAT_BC2_UNORM_SRGB 75
|
||||
%define DXGI_FORMAT_BC3_TYPELESS 76
|
||||
%define DXGI_FORMAT_BC3_UNORM 77
|
||||
%define DXGI_FORMAT_BC3_UNORM_SRGB 78
|
||||
%define DXGI_FORMAT_BC4_TYPELESS 79
|
||||
%define DXGI_FORMAT_BC4_UNORM 80
|
||||
%define DXGI_FORMAT_BC4_SNORM 81
|
||||
%define DXGI_FORMAT_BC5_TYPELESS 82
|
||||
%define DXGI_FORMAT_BC5_UNORM 83
|
||||
%define DXGI_FORMAT_BC5_SNORM 84
|
||||
%define DXGI_FORMAT_B5G6R5_UNORM 85
|
||||
%define DXGI_FORMAT_B5G5R5A1_UNORM 86
|
||||
%define DXGI_FORMAT_B8G8R8A8_UNORM 87
|
||||
%define DXGI_FORMAT_B8G8R8X8_UNORM 88
|
||||
%define DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM 89
|
||||
%define DXGI_FORMAT_B8G8R8A8_TYPELESS 90
|
||||
%define DXGI_FORMAT_B8G8R8A8_UNORM_SRGB 91
|
||||
%define DXGI_FORMAT_B8G8R8X8_TYPELESS 92
|
||||
%define DXGI_FORMAT_B8G8R8X8_UNORM_SRGB 93
|
||||
%define DXGI_FORMAT_BC6H_TYPELESS 94
|
||||
%define DXGI_FORMAT_BC6H_UF16 95
|
||||
%define DXGI_FORMAT_BC6H_SF16 96
|
||||
%define DXGI_FORMAT_BC7_TYPELESS 97
|
||||
%define DXGI_FORMAT_BC7_UNORM 98
|
||||
%define DXGI_FORMAT_BC7_UNORM_SRGB 99
|
||||
%define DXGI_FORMAT_AYUV 100
|
||||
%define DXGI_FORMAT_Y410 101
|
||||
%define DXGI_FORMAT_Y416 102
|
||||
%define DXGI_FORMAT_NV12 103
|
||||
%define DXGI_FORMAT_P010 104
|
||||
%define DXGI_FORMAT_P016 105
|
||||
%define DXGI_FORMAT_420_OPAQUE 106
|
||||
%define DXGI_FORMAT_YUY2 107
|
||||
%define DXGI_FORMAT_Y210 108
|
||||
%define DXGI_FORMAT_Y216 109
|
||||
%define DXGI_FORMAT_NV11 110
|
||||
%define DXGI_FORMAT_AI44 111
|
||||
%define DXGI_FORMAT_IA44 112
|
||||
%define DXGI_FORMAT_P8 113
|
||||
%define DXGI_FORMAT_A8P8 114
|
||||
%define DXGI_FORMAT_B4G4R4A4_UNORM 115
|
||||
%define DXGI_FORMAT_FORCE_UINT 0xffffffff
|
||||
|
||||
; DXGI_MODE_SCANLINE_ORDER
|
||||
%define DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED 0
|
||||
%define DXGI_MODE_SCANLINE_ORDER_PROGRESSIVE 1
|
||||
%define DXGI_MODE_SCANLINE_ORDER_UPPER_FIELD_FIRST 2
|
||||
%define DXGI_MODE_SCANLINE_ORDER_LOWER_FIELD_FIRST 3
|
||||
|
||||
; DXGI_MODE_SCALING
|
||||
%define DXGI_MODE_SCALING_UNSPECIFIED 0
|
||||
%define DXGI_MODE_SCALING_CENTERED 1
|
||||
%define DXGI_MODE_SCALING_STRETCHED 2
|
||||
|
||||
; DXGI_MODE_ROTATION
|
||||
%define DXGI_MODE_ROTATION_UNSPECIFIED 0
|
||||
%define DXGI_MODE_ROTATION_IDENTITY 1
|
||||
%define DXGI_MODE_ROTATION_ROTATE90 2
|
||||
%define DXGI_MODE_ROTATION_ROTATE180 3
|
||||
%define DXGI_MODE_ROTATION_ROTATE270 4
|
||||
|
||||
|
||||
%define DXGI_CPU_ACCESS_NONE (0)
|
||||
%define DXGI_CPU_ACCESS_DYNAMIC (1)
|
||||
%define DXGI_CPU_ACCESS_READ_WRITE (2)
|
||||
%define DXGI_CPU_ACCESS_SCRATCH (3)
|
||||
%define DXGI_CPU_ACCESS_FIELD 15
|
||||
%define DXGI_USAGE_SHADER_INPUT (1<<(0 + 4))
|
||||
%define DXGI_USAGE_RENDER_TARGET_OUTPUT (1<<(1 + 4))
|
||||
%define DXGI_USAGE_BACK_BUFFER (1<<(2 + 4))
|
||||
%define DXGI_USAGE_SHARED (1<<(3 + 4))
|
||||
%define DXGI_USAGE_READ_ONLY (1<<(4 + 4))
|
||||
%define DXGI_USAGE_DISCARD_ON_PRESENT (1<<(5 + 4))
|
||||
%define DXGI_USAGE_UNORDERED_ACCESS (1<<(6 + 4))
|
||||
%define DXGI_RESOURCE_PRIORITY_MINIMUM (0x28000000)
|
||||
%define DXGI_RESOURCE_PRIORITY_LOW (0x50000000)
|
||||
%define DXGI_RESOURCE_PRIORITY_NORMAL (0x78000000)
|
||||
%define DXGI_RESOURCE_PRIORITY_HIGH (0xa0000000)
|
||||
%define DXGI_RESOURCE_PRIORITY_MAXIMUM (0xc8000000)
|
||||
%define DXGI_MAP_READ (1)
|
||||
%define DXGI_MAP_WRITE (2)
|
||||
%define DXGI_MAP_DISCARD (4)
|
||||
%define DXGI_ENUM_MODES_INTERLACED (1)
|
||||
%define DXGI_ENUM_MODES_SCALING (2)
|
||||
%define DXGI_MAX_SWAP_CHAIN_BUFFERS (16)
|
||||
%define DXGI_PRESENT_TEST 0x00000001
|
||||
%define DXGI_PRESENT_DO_NOT_SEQUENCE 0x00000002
|
||||
%define DXGI_PRESENT_RESTART 0x00000004
|
||||
%define DXGI_PRESENT_DO_NOT_WAIT 0x00000008
|
||||
%define DXGI_PRESENT_STEREO_PREFER_RIGHT 0x00000010
|
||||
%define DXGI_PRESENT_STEREO_TEMPORARY_MONO 0x00000020
|
||||
%define DXGI_PRESENT_RESTRICT_TO_OUTPUT 0x00000040
|
||||
%define DXGI_PRESENT_USE_DURATION 0x00000100
|
||||
%define DXGI_MWA_NO_WINDOW_CHANGES (1<<0)
|
||||
%define DXGI_MWA_NO_ALT_ENTER (1<<1)
|
||||
%define DXGI_MWA_NO_PRINT_SCREEN (1<<2)
|
||||
%define DXGI_MWA_VALID (0x7)
|
||||
%define DXGI_FORMAT_DEFINED 1
|
||||
%define _FACDXGI 0x87a
|
||||
%define MAKE_DXGI_HRESULT(code) MAKE_HRESULT(1, _FACDXGI, code)
|
||||
%define MAKE_DXGI_STATUS(code) MAKE_HRESULT(0, _FACDXGI, code)
|
||||
%define DXGI_CPU_ACCESS_NONE (0)
|
||||
%define DXGI_CPU_ACCESS_DYNAMIC (1)
|
||||
%define DXGI_CPU_ACCESS_READ_WRITE (2)
|
||||
%define DXGI_CPU_ACCESS_SCRATCH (3)
|
||||
%define DXGI_CPU_ACCESS_FIELD 15
|
||||
%define DXGI_USAGE_SHADER_INPUT (1<<(0 + 4))
|
||||
%define DXGI_USAGE_RENDER_TARGET_OUTPUT (1<<(1 + 4))
|
||||
%define DXGI_USAGE_BACK_BUFFER (1<<(2 + 4))
|
||||
%define DXGI_USAGE_SHARED (1<<(3 + 4))
|
||||
%define DXGI_USAGE_READ_ONLY (1<<(4 + 4))
|
||||
%define DXGI_USAGE_DISCARD_ON_PRESENT (1<<(5 + 4))
|
||||
%define DXGI_USAGE_UNORDERED_ACCESS (1<<(6 + 4))
|
||||
|
||||
|
||||
struc IDXGIObject
|
||||
.QueryInterface: resb 4
|
||||
.AddRef: resb 4
|
||||
.Release: resb 4
|
||||
.SetPrivateData: resb 4
|
||||
.SetPrivateDataInterface: resb 4
|
||||
.GetPrivateData: resb 4
|
||||
.GetParent: resb 4
|
||||
endstruc
|
||||
|
||||
struc IDXGIDeviceSubObject
|
||||
.QueryInterface: resb 4
|
||||
.AddRef: resb 4
|
||||
.Release: resb 4
|
||||
.SetPrivateData: resb 4
|
||||
.SetPrivateDataInterface: resb 4
|
||||
.GetPrivateData: resb 4
|
||||
.GetParent: resb 4
|
||||
.GetDevice: resb 4
|
||||
endstruc
|
||||
|
||||
struc IDXGIResource
|
||||
.QueryInterface: resb 4
|
||||
.AddRef: resb 4
|
||||
.Release: resb 4
|
||||
.SetPrivateData: resb 4
|
||||
.SetPrivateDataInterface: resb 4
|
||||
.GetPrivateData: resb 4
|
||||
.GetParent: resb 4
|
||||
.GetDevice: resb 4
|
||||
.GetSharedHandle: resb 4
|
||||
.GetUsage: resb 4
|
||||
.SetEvictionPriority: resb 4
|
||||
.GetEvictionPriority: resb 4
|
||||
endstruc
|
||||
|
||||
struc IDXGIKeyedMutex
|
||||
.QueryInterface: resb 4
|
||||
.AddRef: resb 4
|
||||
.Release: resb 4
|
||||
.SetPrivateData: resb 4
|
||||
.SetPrivateDataInterface: resb 4
|
||||
.GetPrivateData: resb 4
|
||||
.GetParent: resb 4
|
||||
.GetDevice: resb 4
|
||||
.AcquireSync: resb 4
|
||||
.ReleaseSync: resb 4
|
||||
endstruc
|
||||
|
||||
struc IDXGISurface
|
||||
.QueryInterface: resb 4
|
||||
.AddRef: resb 4
|
||||
.Release: resb 4
|
||||
.SetPrivateData: resb 4
|
||||
.SetPrivateDataInterface: resb 4
|
||||
.GetPrivateData: resb 4
|
||||
.GetParent: resb 4
|
||||
.GetDevice: resb 4
|
||||
.GetDesc: resb 4
|
||||
.Map: resb 4
|
||||
.Unmap: resb 4
|
||||
endstruc
|
||||
|
||||
struc IDXGISurface1
|
||||
.QueryInterface: resb 4
|
||||
.AddRef: resb 4
|
||||
.Release: resb 4
|
||||
.SetPrivateData: resb 4
|
||||
.SetPrivateDataInterface: resb 4
|
||||
.GetPrivateData: resb 4
|
||||
.GetParent: resb 4
|
||||
.GetDevice: resb 4
|
||||
.GetDesc: resb 4
|
||||
.Map: resb 4
|
||||
.Unmap: resb 4
|
||||
.GetDC: resb 4
|
||||
.ReleaseDC: resb 4
|
||||
endstruc
|
||||
|
||||
struc IDXGIAdapter
|
||||
.QueryInterface: resb 4
|
||||
.AddRef: resb 4
|
||||
.Release: resb 4
|
||||
.SetPrivateData: resb 4
|
||||
.SetPrivateDataInterface: resb 4
|
||||
.GetPrivateData: resb 4
|
||||
.GetParent: resb 4
|
||||
.EnumOutputs: resb 4
|
||||
.GetDesc: resb 4
|
||||
.CheckInterfaceSupport: resb 4
|
||||
endstruc
|
||||
|
||||
struc IDXGIOutput
|
||||
.QueryInterface: resb 4
|
||||
.AddRef: resb 4
|
||||
.Release: resb 4
|
||||
.SetPrivateData: resb 4
|
||||
.SetPrivateDataInterface: resb 4
|
||||
.GetPrivateData: resb 4
|
||||
.GetParent: resb 4
|
||||
.GetDesc: resb 4
|
||||
.GetDisplayModeList: resb 4
|
||||
.FindClosestMatchingMode: resb 4
|
||||
.WaitForVBlank: resb 4
|
||||
.TakeOwnership: resb 4
|
||||
.ReleaseOwnership: resb 4
|
||||
.GetGammaControlCapabilities: resb 4
|
||||
.SetGammaControl: resb 4
|
||||
.GetGammaControl: resb 4
|
||||
.SetDisplaySurface: resb 4
|
||||
.GetDisplaySurfaceData: resb 4
|
||||
.GetFrameStatistics: resb 4
|
||||
endstruc
|
||||
|
||||
struc IDXGISwapChain
|
||||
.QueryInterface: resb 4
|
||||
.AddRef: resb 4
|
||||
.Release: resb 4
|
||||
.SetPrivateData: resb 4
|
||||
.SetPrivateDataInterface: resb 4
|
||||
.GetPrivateData: resb 4
|
||||
.GetParent: resb 4
|
||||
.GetDevice: resb 4
|
||||
.Present: resb 4
|
||||
.GetBuffer: resb 4
|
||||
.SetFullscreenState: resb 4
|
||||
.GetFullscreenState: resb 4
|
||||
.GetDesc: resb 4
|
||||
.ResizeBuffers: resb 4
|
||||
.ResizeTarget: resb 4
|
||||
.GetContainingOutput: resb 4
|
||||
.GetFrameStatistics: resb 4
|
||||
.GetLastPresentCount: resb 4
|
||||
endstruc
|
||||
|
||||
struc IDXGIFactory
|
||||
.QueryInterface: resb 4
|
||||
.AddRef: resb 4
|
||||
.Release: resb 4
|
||||
.SetPrivateData: resb 4
|
||||
.SetPrivateDataInterface: resb 4
|
||||
.GetPrivateData: resb 4
|
||||
.GetParent: resb 4
|
||||
.EnumAdapters: resb 4
|
||||
.MakeWindowAssociation: resb 4
|
||||
.GetWindowAssociation: resb 4
|
||||
.CreateSwapChain: resb 4
|
||||
.CreateSoftwareAdapter: resb 4
|
||||
endstruc
|
||||
|
||||
struc IDXGIDevice
|
||||
.QueryInterface: resb 4
|
||||
.AddRef: resb 4
|
||||
.Release: resb 4
|
||||
.SetPrivateData: resb 4
|
||||
.SetPrivateDataInterface: resb 4
|
||||
.GetPrivateData: resb 4
|
||||
.GetParent: resb 4
|
||||
.GetAdapter: resb 4
|
||||
.CreateSurface: resb 4
|
||||
.QueryResourceResidency: resb 4
|
||||
.SetGPUThreadPriority: resb 4
|
||||
.GetGPUThreadPriority: resb 4
|
||||
endstruc
|
||||
|
||||
struc IDXGIFactory1
|
||||
.QueryInterface: resb 4
|
||||
.AddRef: resb 4
|
||||
.Release: resb 4
|
||||
.SetPrivateData: resb 4
|
||||
.SetPrivateDataInterface: resb 4
|
||||
.GetPrivateData: resb 4
|
||||
.GetParent: resb 4
|
||||
.EnumAdapters: resb 4
|
||||
.MakeWindowAssociation: resb 4
|
||||
.GetWindowAssociation: resb 4
|
||||
.CreateSwapChain: resb 4
|
||||
.CreateSoftwareAdapter: resb 4
|
||||
.EnumAdapters1: resb 4
|
||||
.IsCurrent: resb 4
|
||||
endstruc
|
||||
|
||||
struc IDXGIAdapter1
|
||||
.QueryInterface: resb 4
|
||||
.AddRef: resb 4
|
||||
.Release: resb 4
|
||||
.SetPrivateData: resb 4
|
||||
.SetPrivateDataInterface: resb 4
|
||||
.GetPrivateData: resb 4
|
||||
.GetParent: resb 4
|
||||
.EnumOutputs: resb 4
|
||||
.GetDesc: resb 4
|
||||
.CheckInterfaceSupport: resb 4
|
||||
.GetDesc1: resb 4
|
||||
endstruc
|
||||
|
||||
struc IDXGIDevice1
|
||||
.QueryInterface: resb 4
|
||||
.AddRef: resb 4
|
||||
.Release: resb 4
|
||||
.SetPrivateData: resb 4
|
||||
.SetPrivateDataInterface: resb 4
|
||||
.GetPrivateData: resb 4
|
||||
.GetParent: resb 4
|
||||
.GetAdapter: resb 4
|
||||
.CreateSurface: resb 4
|
||||
.QueryResourceResidency: resb 4
|
||||
.SetGPUThreadPriority: resb 4
|
||||
.GetGPUThreadPriority: resb 4
|
||||
.SetMaximumFrameLatency: resb 4
|
||||
.GetMaximumFrameLatency: resb 4
|
||||
endstruc
|
||||
@@ -0,0 +1,131 @@
|
||||
//
|
||||
// Copyright (C) Microsoft. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef __dxgiformat_h__
|
||||
#define __dxgiformat_h__
|
||||
|
||||
#define DXGI_FORMAT_DEFINED 1
|
||||
|
||||
typedef enum DXGI_FORMAT
|
||||
{
|
||||
DXGI_FORMAT_UNKNOWN = 0,
|
||||
DXGI_FORMAT_R32G32B32A32_TYPELESS = 1,
|
||||
DXGI_FORMAT_R32G32B32A32_FLOAT = 2,
|
||||
DXGI_FORMAT_R32G32B32A32_UINT = 3,
|
||||
DXGI_FORMAT_R32G32B32A32_SINT = 4,
|
||||
DXGI_FORMAT_R32G32B32_TYPELESS = 5,
|
||||
DXGI_FORMAT_R32G32B32_FLOAT = 6,
|
||||
DXGI_FORMAT_R32G32B32_UINT = 7,
|
||||
DXGI_FORMAT_R32G32B32_SINT = 8,
|
||||
DXGI_FORMAT_R16G16B16A16_TYPELESS = 9,
|
||||
DXGI_FORMAT_R16G16B16A16_FLOAT = 10,
|
||||
DXGI_FORMAT_R16G16B16A16_UNORM = 11,
|
||||
DXGI_FORMAT_R16G16B16A16_UINT = 12,
|
||||
DXGI_FORMAT_R16G16B16A16_SNORM = 13,
|
||||
DXGI_FORMAT_R16G16B16A16_SINT = 14,
|
||||
DXGI_FORMAT_R32G32_TYPELESS = 15,
|
||||
DXGI_FORMAT_R32G32_FLOAT = 16,
|
||||
DXGI_FORMAT_R32G32_UINT = 17,
|
||||
DXGI_FORMAT_R32G32_SINT = 18,
|
||||
DXGI_FORMAT_R32G8X24_TYPELESS = 19,
|
||||
DXGI_FORMAT_D32_FLOAT_S8X24_UINT = 20,
|
||||
DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS = 21,
|
||||
DXGI_FORMAT_X32_TYPELESS_G8X24_UINT = 22,
|
||||
DXGI_FORMAT_R10G10B10A2_TYPELESS = 23,
|
||||
DXGI_FORMAT_R10G10B10A2_UNORM = 24,
|
||||
DXGI_FORMAT_R10G10B10A2_UINT = 25,
|
||||
DXGI_FORMAT_R11G11B10_FLOAT = 26,
|
||||
DXGI_FORMAT_R8G8B8A8_TYPELESS = 27,
|
||||
DXGI_FORMAT_R8G8B8A8_UNORM = 28,
|
||||
DXGI_FORMAT_R8G8B8A8_UNORM_SRGB = 29,
|
||||
DXGI_FORMAT_R8G8B8A8_UINT = 30,
|
||||
DXGI_FORMAT_R8G8B8A8_SNORM = 31,
|
||||
DXGI_FORMAT_R8G8B8A8_SINT = 32,
|
||||
DXGI_FORMAT_R16G16_TYPELESS = 33,
|
||||
DXGI_FORMAT_R16G16_FLOAT = 34,
|
||||
DXGI_FORMAT_R16G16_UNORM = 35,
|
||||
DXGI_FORMAT_R16G16_UINT = 36,
|
||||
DXGI_FORMAT_R16G16_SNORM = 37,
|
||||
DXGI_FORMAT_R16G16_SINT = 38,
|
||||
DXGI_FORMAT_R32_TYPELESS = 39,
|
||||
DXGI_FORMAT_D32_FLOAT = 40,
|
||||
DXGI_FORMAT_R32_FLOAT = 41,
|
||||
DXGI_FORMAT_R32_UINT = 42,
|
||||
DXGI_FORMAT_R32_SINT = 43,
|
||||
DXGI_FORMAT_R24G8_TYPELESS = 44,
|
||||
DXGI_FORMAT_D24_UNORM_S8_UINT = 45,
|
||||
DXGI_FORMAT_R24_UNORM_X8_TYPELESS = 46,
|
||||
DXGI_FORMAT_X24_TYPELESS_G8_UINT = 47,
|
||||
DXGI_FORMAT_R8G8_TYPELESS = 48,
|
||||
DXGI_FORMAT_R8G8_UNORM = 49,
|
||||
DXGI_FORMAT_R8G8_UINT = 50,
|
||||
DXGI_FORMAT_R8G8_SNORM = 51,
|
||||
DXGI_FORMAT_R8G8_SINT = 52,
|
||||
DXGI_FORMAT_R16_TYPELESS = 53,
|
||||
DXGI_FORMAT_R16_FLOAT = 54,
|
||||
DXGI_FORMAT_D16_UNORM = 55,
|
||||
DXGI_FORMAT_R16_UNORM = 56,
|
||||
DXGI_FORMAT_R16_UINT = 57,
|
||||
DXGI_FORMAT_R16_SNORM = 58,
|
||||
DXGI_FORMAT_R16_SINT = 59,
|
||||
DXGI_FORMAT_R8_TYPELESS = 60,
|
||||
DXGI_FORMAT_R8_UNORM = 61,
|
||||
DXGI_FORMAT_R8_UINT = 62,
|
||||
DXGI_FORMAT_R8_SNORM = 63,
|
||||
DXGI_FORMAT_R8_SINT = 64,
|
||||
DXGI_FORMAT_A8_UNORM = 65,
|
||||
DXGI_FORMAT_R1_UNORM = 66,
|
||||
DXGI_FORMAT_R9G9B9E5_SHAREDEXP = 67,
|
||||
DXGI_FORMAT_R8G8_B8G8_UNORM = 68,
|
||||
DXGI_FORMAT_G8R8_G8B8_UNORM = 69,
|
||||
DXGI_FORMAT_BC1_TYPELESS = 70,
|
||||
DXGI_FORMAT_BC1_UNORM = 71,
|
||||
DXGI_FORMAT_BC1_UNORM_SRGB = 72,
|
||||
DXGI_FORMAT_BC2_TYPELESS = 73,
|
||||
DXGI_FORMAT_BC2_UNORM = 74,
|
||||
DXGI_FORMAT_BC2_UNORM_SRGB = 75,
|
||||
DXGI_FORMAT_BC3_TYPELESS = 76,
|
||||
DXGI_FORMAT_BC3_UNORM = 77,
|
||||
DXGI_FORMAT_BC3_UNORM_SRGB = 78,
|
||||
DXGI_FORMAT_BC4_TYPELESS = 79,
|
||||
DXGI_FORMAT_BC4_UNORM = 80,
|
||||
DXGI_FORMAT_BC4_SNORM = 81,
|
||||
DXGI_FORMAT_BC5_TYPELESS = 82,
|
||||
DXGI_FORMAT_BC5_UNORM = 83,
|
||||
DXGI_FORMAT_BC5_SNORM = 84,
|
||||
DXGI_FORMAT_B5G6R5_UNORM = 85,
|
||||
DXGI_FORMAT_B5G5R5A1_UNORM = 86,
|
||||
DXGI_FORMAT_B8G8R8A8_UNORM = 87,
|
||||
DXGI_FORMAT_B8G8R8X8_UNORM = 88,
|
||||
DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM = 89,
|
||||
DXGI_FORMAT_B8G8R8A8_TYPELESS = 90,
|
||||
DXGI_FORMAT_B8G8R8A8_UNORM_SRGB = 91,
|
||||
DXGI_FORMAT_B8G8R8X8_TYPELESS = 92,
|
||||
DXGI_FORMAT_B8G8R8X8_UNORM_SRGB = 93,
|
||||
DXGI_FORMAT_BC6H_TYPELESS = 94,
|
||||
DXGI_FORMAT_BC6H_UF16 = 95,
|
||||
DXGI_FORMAT_BC6H_SF16 = 96,
|
||||
DXGI_FORMAT_BC7_TYPELESS = 97,
|
||||
DXGI_FORMAT_BC7_UNORM = 98,
|
||||
DXGI_FORMAT_BC7_UNORM_SRGB = 99,
|
||||
DXGI_FORMAT_AYUV = 100,
|
||||
DXGI_FORMAT_Y410 = 101,
|
||||
DXGI_FORMAT_Y416 = 102,
|
||||
DXGI_FORMAT_NV12 = 103,
|
||||
DXGI_FORMAT_P010 = 104,
|
||||
DXGI_FORMAT_P016 = 105,
|
||||
DXGI_FORMAT_420_OPAQUE = 106,
|
||||
DXGI_FORMAT_YUY2 = 107,
|
||||
DXGI_FORMAT_Y210 = 108,
|
||||
DXGI_FORMAT_Y216 = 109,
|
||||
DXGI_FORMAT_NV11 = 110,
|
||||
DXGI_FORMAT_AI44 = 111,
|
||||
DXGI_FORMAT_IA44 = 112,
|
||||
DXGI_FORMAT_P8 = 113,
|
||||
DXGI_FORMAT_A8P8 = 114,
|
||||
DXGI_FORMAT_B4G4R4A4_UNORM = 115,
|
||||
DXGI_FORMAT_FORCE_UINT = 0xffffffff
|
||||
} DXGI_FORMAT;
|
||||
|
||||
#endif // __dxgiformat_h__
|
||||
113
hgplus/las/framework-dx11-nasm/tools/headerGenerator/dxgitype.h
Normal file
113
hgplus/las/framework-dx11-nasm/tools/headerGenerator/dxgitype.h
Normal file
@@ -0,0 +1,113 @@
|
||||
//
|
||||
// Copyright (C) Microsoft. All rights reserved.
|
||||
//
|
||||
#ifndef __dxgitype_h__
|
||||
#define __dxgitype_h__
|
||||
|
||||
|
||||
#include "dxgiformat.h"
|
||||
|
||||
#define _FACDXGI 0x87a
|
||||
#define MAKE_DXGI_HRESULT(code) MAKE_HRESULT(1, _FACDXGI, code)
|
||||
#define MAKE_DXGI_STATUS(code) MAKE_HRESULT(0, _FACDXGI, code)
|
||||
|
||||
// DXGI error messages have moved to winerror.h
|
||||
|
||||
#define DXGI_CPU_ACCESS_NONE ( 0 )
|
||||
#define DXGI_CPU_ACCESS_DYNAMIC ( 1 )
|
||||
#define DXGI_CPU_ACCESS_READ_WRITE ( 2 )
|
||||
#define DXGI_CPU_ACCESS_SCRATCH ( 3 )
|
||||
#define DXGI_CPU_ACCESS_FIELD 15
|
||||
|
||||
#define DXGI_USAGE_SHADER_INPUT ( 1L << (0 + 4) )
|
||||
#define DXGI_USAGE_RENDER_TARGET_OUTPUT ( 1L << (1 + 4) )
|
||||
#define DXGI_USAGE_BACK_BUFFER ( 1L << (2 + 4) )
|
||||
#define DXGI_USAGE_SHARED ( 1L << (3 + 4) )
|
||||
#define DXGI_USAGE_READ_ONLY ( 1L << (4 + 4) )
|
||||
#define DXGI_USAGE_DISCARD_ON_PRESENT ( 1L << (5 + 4) )
|
||||
#define DXGI_USAGE_UNORDERED_ACCESS ( 1L << (6 + 4) )
|
||||
|
||||
typedef struct DXGI_RGB
|
||||
{
|
||||
float Red;
|
||||
float Green;
|
||||
float Blue;
|
||||
} DXGI_RGB;
|
||||
|
||||
#ifndef D3DCOLORVALUE_DEFINED
|
||||
typedef struct _D3DCOLORVALUE {
|
||||
float r;
|
||||
float g;
|
||||
float b;
|
||||
float a;
|
||||
} D3DCOLORVALUE;
|
||||
|
||||
#define D3DCOLORVALUE_DEFINED
|
||||
#endif
|
||||
|
||||
typedef D3DCOLORVALUE DXGI_RGBA;
|
||||
|
||||
typedef struct DXGI_GAMMA_CONTROL
|
||||
{
|
||||
DXGI_RGB Scale;
|
||||
DXGI_RGB Offset;
|
||||
DXGI_RGB GammaCurve[ 1025 ];
|
||||
} DXGI_GAMMA_CONTROL;
|
||||
|
||||
typedef struct DXGI_GAMMA_CONTROL_CAPABILITIES
|
||||
{
|
||||
BOOL ScaleAndOffsetSupported;
|
||||
float MaxConvertedValue;
|
||||
float MinConvertedValue;
|
||||
UINT NumGammaControlPoints;
|
||||
float ControlPointPositions[1025];
|
||||
} DXGI_GAMMA_CONTROL_CAPABILITIES;
|
||||
|
||||
typedef struct DXGI_RATIONAL
|
||||
{
|
||||
UINT Numerator;
|
||||
UINT Denominator;
|
||||
} DXGI_RATIONAL;
|
||||
|
||||
typedef enum DXGI_MODE_SCANLINE_ORDER
|
||||
{
|
||||
DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED = 0,
|
||||
DXGI_MODE_SCANLINE_ORDER_PROGRESSIVE = 1,
|
||||
DXGI_MODE_SCANLINE_ORDER_UPPER_FIELD_FIRST = 2,
|
||||
DXGI_MODE_SCANLINE_ORDER_LOWER_FIELD_FIRST = 3
|
||||
} DXGI_MODE_SCANLINE_ORDER;
|
||||
|
||||
typedef enum DXGI_MODE_SCALING
|
||||
{
|
||||
DXGI_MODE_SCALING_UNSPECIFIED = 0,
|
||||
DXGI_MODE_SCALING_CENTERED = 1,
|
||||
DXGI_MODE_SCALING_STRETCHED = 2
|
||||
} DXGI_MODE_SCALING;
|
||||
|
||||
typedef enum DXGI_MODE_ROTATION
|
||||
{
|
||||
DXGI_MODE_ROTATION_UNSPECIFIED = 0,
|
||||
DXGI_MODE_ROTATION_IDENTITY = 1,
|
||||
DXGI_MODE_ROTATION_ROTATE90 = 2,
|
||||
DXGI_MODE_ROTATION_ROTATE180 = 3,
|
||||
DXGI_MODE_ROTATION_ROTATE270 = 4
|
||||
} DXGI_MODE_ROTATION;
|
||||
|
||||
typedef struct DXGI_MODE_DESC
|
||||
{
|
||||
UINT Width;
|
||||
UINT Height;
|
||||
DXGI_RATIONAL RefreshRate;
|
||||
DXGI_FORMAT Format;
|
||||
DXGI_MODE_SCANLINE_ORDER ScanlineOrdering;
|
||||
DXGI_MODE_SCALING Scaling;
|
||||
} DXGI_MODE_DESC;
|
||||
|
||||
typedef struct DXGI_SAMPLE_DESC
|
||||
{
|
||||
UINT Count;
|
||||
UINT Quality;
|
||||
} DXGI_SAMPLE_DESC;
|
||||
|
||||
#endif // __dxgitype_h__
|
||||
|
||||
@@ -0,0 +1,669 @@
|
||||
#include <Windows.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <regex>
|
||||
|
||||
typedef UINT uint;
|
||||
|
||||
#define LogMessage(...) do { fprintf(stderr, "[%s:%d]", __FILE__, __LINE__); fprintf(stderr, __VA_ARGS__); } while(0);
|
||||
|
||||
#define SOURCE_LINE_FLAG_NONE 0
|
||||
#define SOURCE_LINE_FLAG_DISCARD 1
|
||||
#define SOURCE_LINE_FLAG_FORCE_NEWLINE 2
|
||||
|
||||
struct SourceLine {
|
||||
SourceLine(uint l, const std::string& s) : lineNumber(l), string(s), flag(SOURCE_LINE_FLAG_NONE) {}
|
||||
uint lineNumber;
|
||||
std::string string;
|
||||
uint flag;
|
||||
};
|
||||
|
||||
struct EnumBlock {
|
||||
std::string enumName;
|
||||
std::vector<std::pair<std::string,std::string>> enumEntries;
|
||||
};
|
||||
|
||||
struct InterfaceBlock {
|
||||
std::string interfaceName;
|
||||
std::string interfaceGUID;
|
||||
std::vector<std::string> interfaceMethods;
|
||||
|
||||
};
|
||||
|
||||
struct StructBlock {
|
||||
std::string structName;
|
||||
std::vector<std::pair<std::string, std::string>> structEntries;
|
||||
};
|
||||
|
||||
struct DefineBlock {
|
||||
std::vector<std::pair<std::string,std::string>> defines;
|
||||
};
|
||||
|
||||
static size_t getFileSize(const char* filename) {
|
||||
FILE* f = fopen(filename, "rb");
|
||||
if (f == NULL) return 0;
|
||||
fseek(f, 0, SEEK_END);
|
||||
size_t size = ftell(f);
|
||||
fclose(f);
|
||||
return size;
|
||||
}
|
||||
|
||||
static bool readLinesFromFile(const char* filename, std::vector<SourceLine>& lines) {
|
||||
std::ifstream ifs;
|
||||
ifs.open(filename, std::ios::in);
|
||||
if (!ifs.good()) {
|
||||
LogMessage("readLinesFromFile() - could not open file %s", filename);
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string str;
|
||||
uint lineNumber = 0;
|
||||
while (ifs.good() && getline(ifs, str))
|
||||
lines.push_back(SourceLine(++lineNumber, str));
|
||||
ifs.close();
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string trim(std::string& s) {
|
||||
s.erase(0, s.find_first_not_of(" \t\n\r\v\f"));
|
||||
s.erase(s.find_last_not_of(" \t\n\r\v\f") + 1);
|
||||
return s;
|
||||
}
|
||||
|
||||
void inplaceFindAndReplace(std::string& src, const std::string& find, const std::string& replace) {
|
||||
std::string::size_type j, s = 0;
|
||||
while ((j = src.find(find, s)) != std::string::npos) {
|
||||
src.replace(j, find.length(), replace);
|
||||
s = j + replace.length();
|
||||
}
|
||||
}
|
||||
|
||||
std::string regexReplace(const std::string& src, const std::string& rgx, const std::string& fmt) {
|
||||
return std::tr1::regex_replace(src, std::tr1::regex(rgx), fmt);
|
||||
}
|
||||
|
||||
static void stripLines(std::vector<SourceLine>& lines) {
|
||||
bool removeComments = true;
|
||||
bool removeFiles = true;
|
||||
bool removeStrings = true;
|
||||
bool removeSpaces = true;
|
||||
bool removeLocations = true;
|
||||
bool removeTabulators = true;
|
||||
bool replaceTemp = true;
|
||||
const char* tempString = "%temp";
|
||||
const char* tempReplacementString = "%_";
|
||||
|
||||
uint N = lines.size();
|
||||
for (uint i = 0; i < N; ++i) {
|
||||
SourceLine& sl = lines[i];
|
||||
|
||||
// Trim left and right whitespaces
|
||||
trim(sl.string);
|
||||
|
||||
if (sl.string.empty()) {
|
||||
// Remove empty lines
|
||||
sl.flag |= SOURCE_LINE_FLAG_DISCARD;
|
||||
} else if (sl.string.find("//") == 0 && removeComments) {
|
||||
// Remove comments
|
||||
sl.flag |= SOURCE_LINE_FLAG_DISCARD;
|
||||
} else if (sl.string.find(".file") == 0 && removeFiles) {
|
||||
// Remove .file
|
||||
sl.flag |= SOURCE_LINE_FLAG_DISCARD;
|
||||
} else if (sl.string.find(".b8 $str") != std::string::npos && removeStrings) {
|
||||
// Remove strings
|
||||
sl.flag |= SOURCE_LINE_FLAG_DISCARD;
|
||||
} else if (sl.string.find(".loc") == 0 && removeLocations) {
|
||||
// Remove locations
|
||||
sl.flag |= SOURCE_LINE_FLAG_DISCARD;
|
||||
} else {
|
||||
// Remove all tabs
|
||||
if (removeTabulators)
|
||||
inplaceFindAndReplace(sl.string, "\t", "");
|
||||
|
||||
if (removeSpaces) {
|
||||
// Remove possible duplicate spaces
|
||||
inplaceFindAndReplace(sl.string, " ", " ");
|
||||
inplaceFindAndReplace(sl.string, " ", " ");
|
||||
|
||||
// Remove space after ','
|
||||
inplaceFindAndReplace(sl.string, ", ", ",");
|
||||
|
||||
// Remove space before '%'
|
||||
inplaceFindAndReplace(sl.string, " %", "%");
|
||||
|
||||
// Remove space before '['
|
||||
inplaceFindAndReplace(sl.string, " [", "[");
|
||||
|
||||
// Remove space before '.'
|
||||
//if (sl.string.find(".align") == std::string::npos)
|
||||
// inplaceFindAndReplace(sl.string, " .", ".");
|
||||
sl.string = regexReplace(sl.string, "([A-Za-z_]+)(\\s+)(\\.)", "$1$3");
|
||||
|
||||
}
|
||||
|
||||
if (replaceTemp) {
|
||||
inplaceFindAndReplace(sl.string, tempString, tempReplacementString);
|
||||
}
|
||||
|
||||
// If the string is empty, discard the line
|
||||
if (sl.string.empty()) {
|
||||
sl.flag |= SOURCE_LINE_FLAG_DISCARD;
|
||||
}
|
||||
}
|
||||
|
||||
if ((sl.flag & SOURCE_LINE_FLAG_DISCARD) == 0) {
|
||||
if (sl.string.find(".version") == 0 ||
|
||||
sl.string.find(".target") == 0 ||
|
||||
sl.string.find(".address_size") == 0) {
|
||||
sl.flag |= SOURCE_LINE_FLAG_FORCE_NEWLINE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static bool isValueDefine(const std::string& s, std::string& name, std::string& value) {
|
||||
size_t definePos = s.find("#define");
|
||||
|
||||
if (definePos != std::string::npos &&
|
||||
s.find("__") == std::string::npos && s.find("\\") == std::string::npos) {
|
||||
|
||||
std::string tmp = s.substr(definePos+std::string("#define").size());
|
||||
trim(tmp);
|
||||
size_t whiteSpacePos = tmp.find_first_of(" \t\v");
|
||||
if (whiteSpacePos == std::string::npos) { // || tmp.find("MAKE_D3D11") != std::string::npos || tmp.find("MAKE_DXGI") != std::string::npos) {
|
||||
return false;
|
||||
}
|
||||
|
||||
name = tmp.substr(0, whiteSpacePos);
|
||||
tmp = tmp.substr(whiteSpacePos);
|
||||
trim(tmp);
|
||||
|
||||
inplaceFindAndReplace(tmp, " ", " ");
|
||||
inplaceFindAndReplace(tmp, " ", " ");
|
||||
inplaceFindAndReplace(tmp, " (", "(");
|
||||
inplaceFindAndReplace(tmp, "( ", "(");
|
||||
inplaceFindAndReplace(tmp, " )", ")");
|
||||
inplaceFindAndReplace(tmp, ") ", ")");
|
||||
inplaceFindAndReplace(tmp, "| ", "|");
|
||||
inplaceFindAndReplace(tmp, " |", "|");
|
||||
inplaceFindAndReplace(tmp, " <<", "<<");
|
||||
inplaceFindAndReplace(tmp, "<< ", "<<");
|
||||
inplaceFindAndReplace(tmp, " >>", ">>");
|
||||
inplaceFindAndReplace(tmp, ">> ", ">>");
|
||||
tmp = regexReplace(tmp, "(\\d+)(UL)", "$1");
|
||||
tmp = regexReplace(tmp, "(\\d+)(L)", "$1");
|
||||
tmp = regexReplace(tmp, "(\\d+)(\\.*f)", "$1");
|
||||
value = tmp;
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool isInterfaceDeclaration(const std::string& s, std::string& interfaceName) {
|
||||
size_t typedefPos = s.find("typedef");
|
||||
size_t structPos = s.find("struct");
|
||||
size_t vtblPos = s.find("Vtbl");
|
||||
|
||||
if (typedefPos != std::string::npos && structPos != std::string::npos && vtblPos != std::string::npos) {
|
||||
structPos += std::string("struct").size();
|
||||
std::string tmp = s.substr(structPos, vtblPos - structPos);
|
||||
trim(tmp);
|
||||
//std::cerr << "#" << tmp << "#" << std::endl;
|
||||
interfaceName = tmp;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool isBeginInterface(const std::string& s) {
|
||||
size_t beginInterfacePos = s.find("BEGIN_INTERFACE");
|
||||
if (beginInterfacePos != std::string::npos) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool isFunctionDeclaration(const std::string& s, std::string& functionName) {
|
||||
std::string stringSTDMETHODCALLTYPE("STDMETHODCALLTYPE");
|
||||
size_t stdcallPos = s.find(stringSTDMETHODCALLTYPE);
|
||||
if (stdcallPos != std::string::npos) {
|
||||
std::string tmp = s.substr(stdcallPos + stringSTDMETHODCALLTYPE.size());
|
||||
size_t ptrPos = tmp.find("*")+1;
|
||||
size_t bracketPos = tmp.find(")");
|
||||
tmp = tmp.substr(ptrPos, bracketPos - ptrPos);
|
||||
functionName = trim(tmp);
|
||||
//std::cerr << "#" << tmp << "#" << std::endl;
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
static bool isEndInterface(const std::string& s) {
|
||||
size_t beginInterfacePos = s.find("END_INTERFACE");
|
||||
if (beginInterfacePos != std::string::npos) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool isStructDeclaration(const std::string& s, std::string& structName) {
|
||||
size_t typedefPos = s.find("typedef");
|
||||
size_t structPos = s.find("struct");
|
||||
size_t vtblPos = s.find("Vtbl");
|
||||
|
||||
if (typedefPos != std::string::npos && structPos != std::string::npos && vtblPos == std::string::npos) {
|
||||
structPos += std::string("struct").size();
|
||||
std::string tmp = s.substr(structPos);
|
||||
trim(tmp);
|
||||
//std::cerr << "#" << tmp << "#" << std::endl;
|
||||
structName = tmp;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
static bool isEnum(const std::string& s, std::string& enumName) {
|
||||
size_t enumPos = s.find("enum");
|
||||
if (enumPos != std::string::npos) {
|
||||
std::string tmp = s.substr(enumPos + std::string("enum").size());
|
||||
trim(tmp);
|
||||
enumName = tmp;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool isValidEnumEntry(const std::string& s, std::string& name, std::string& value) {
|
||||
size_t equalSignPos = s.find("=");
|
||||
if (equalSignPos == std::string::npos)
|
||||
return false;
|
||||
|
||||
std::string tmp = s.substr(0, equalSignPos);
|
||||
trim(tmp);
|
||||
name = tmp;
|
||||
|
||||
tmp = s.substr(equalSignPos+1);
|
||||
|
||||
inplaceFindAndReplace(tmp, ",", " ");
|
||||
inplaceFindAndReplace(tmp, " ", " ");
|
||||
inplaceFindAndReplace(tmp, " ", " ");
|
||||
inplaceFindAndReplace(tmp, " (", "(");
|
||||
inplaceFindAndReplace(tmp, "( ", "(");
|
||||
inplaceFindAndReplace(tmp, " )", ")");
|
||||
inplaceFindAndReplace(tmp, ") ", ")");
|
||||
inplaceFindAndReplace(tmp, "| ", "|");
|
||||
inplaceFindAndReplace(tmp, " |", "|");
|
||||
inplaceFindAndReplace(tmp, " <<", "<<");
|
||||
inplaceFindAndReplace(tmp, "<< ", "<<");
|
||||
inplaceFindAndReplace(tmp, " >>", ">>");
|
||||
inplaceFindAndReplace(tmp, ">> ", ">>");
|
||||
tmp = regexReplace(tmp, "(\\d+)(UL)", "$1");
|
||||
tmp = regexReplace(tmp, "(\\d+)(L)", "$1");
|
||||
tmp = regexReplace(tmp, "(\\d+)(\\.*f)", "$1");
|
||||
|
||||
trim(tmp);
|
||||
|
||||
value = tmp;
|
||||
|
||||
//size_t commaPos = s.find(",");
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool isEnumBegin(const std::string& s) {
|
||||
if (s.find("{") != std::string::npos)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool isEnumEnd(const std::string& s) {
|
||||
if (s.find("}") != std::string::npos)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//static
|
||||
|
||||
static void parseInterfaces(std::vector<SourceLine>& lines, std::vector<InterfaceBlock>& interfaces, std::vector<EnumBlock>& enums, DefineBlock& defineBlock) {
|
||||
bool foundInterfaceBlock = false;
|
||||
bool foundBlockBegin = false;
|
||||
bool foundEnum = false;
|
||||
bool foundEnumBlockBegin = false;
|
||||
|
||||
|
||||
bool end = false;
|
||||
int currentLineIndex = 0;
|
||||
|
||||
std::string interfaceName;
|
||||
std::string methodName;
|
||||
std::string enumName;
|
||||
std::string structName;
|
||||
|
||||
size_t N = lines.size();
|
||||
int currentInterfaceIndex = -1;
|
||||
int currentEnumIndex = -1;
|
||||
|
||||
for (size_t i = 0; i < N; ++i) {
|
||||
SourceLine& sl = lines[i];
|
||||
// Trim left and right whitespaces
|
||||
trim(sl.string);
|
||||
{ // Interfaces
|
||||
if (isInterfaceDeclaration(sl.string, interfaceName)) {
|
||||
//std::cout << "interface " << interfaceName << std::endl;
|
||||
foundInterfaceBlock = true;
|
||||
}
|
||||
|
||||
if (isBeginInterface(sl.string) && foundInterfaceBlock) {
|
||||
foundBlockBegin = true;
|
||||
|
||||
InterfaceBlock ib;
|
||||
ib.interfaceMethods.clear();
|
||||
ib.interfaceName = interfaceName;
|
||||
interfaces.push_back(ib);
|
||||
|
||||
currentInterfaceIndex++;
|
||||
}
|
||||
|
||||
if (foundBlockBegin) {
|
||||
if (isFunctionDeclaration(sl.string, methodName)) {
|
||||
//std::cout << "\t" << methodName << std::endl;
|
||||
if (foundBlockBegin) {
|
||||
InterfaceBlock& ib = interfaces.at(currentInterfaceIndex);
|
||||
ib.interfaceMethods.push_back(methodName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isEndInterface(sl.string)) {
|
||||
foundInterfaceBlock = false;
|
||||
foundBlockBegin = false;
|
||||
//std::cout << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
{ // Structs
|
||||
if (isStructDeclaration(sl.string, structName)) {
|
||||
std::cout << structName << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
{ // Defines
|
||||
std::string defineName, defineValue;
|
||||
if (isValueDefine(sl.string, defineName, defineValue)) {
|
||||
//std::cout << defineName<< " " << defineValue << std::endl;
|
||||
defineBlock.defines.push_back(std::make_pair(defineName, defineValue));
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
if (isEnum(sl.string, enumName)) {
|
||||
foundEnum = true;
|
||||
//std::cout << enumName << std::endl;
|
||||
}
|
||||
|
||||
if (foundEnum) {
|
||||
if (isEnumBegin(sl.string)) {
|
||||
foundEnumBlockBegin = true;
|
||||
EnumBlock eb;
|
||||
eb.enumEntries.clear();
|
||||
eb.enumName = enumName;
|
||||
enums.push_back(eb);
|
||||
currentEnumIndex++;
|
||||
}
|
||||
}
|
||||
|
||||
if (foundEnumBlockBegin) {
|
||||
std::string enumElementName, enumElementValue;
|
||||
if (isValidEnumEntry(sl.string, enumElementName, enumElementValue)) {
|
||||
//std::cout << enumElementName << " " << enumElementValue << std::endl;
|
||||
EnumBlock& eb = enums.at(currentEnumIndex);
|
||||
eb.enumEntries.push_back(make_pair(enumElementName, enumElementValue));
|
||||
}
|
||||
}
|
||||
|
||||
if (isEnumEnd(sl.string)) {
|
||||
foundEnum = false;
|
||||
foundEnumBlockBegin = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
size_t numInterfaces = interfaces.size();
|
||||
|
||||
}
|
||||
|
||||
|
||||
static bool writeLinesToFile(const char* filename, const std::vector<SourceLine>& lines) {
|
||||
std::ofstream ofs;
|
||||
ofs.open(filename, std::ios::out);
|
||||
if (!ofs.good()) {
|
||||
LogMessage("writeLinesToFile() - could not open file %s\n", filename);
|
||||
return false;
|
||||
}
|
||||
|
||||
uint N = lines.size();
|
||||
for (uint i = 0; i < N; ++i) {
|
||||
const SourceLine& sl = lines[i];
|
||||
if (sl.flag != SOURCE_LINE_FLAG_DISCARD) {
|
||||
ofs << sl.string;
|
||||
if (sl.flag & SOURCE_LINE_FLAG_FORCE_NEWLINE)
|
||||
ofs << std::endl;
|
||||
}
|
||||
}
|
||||
ofs.close();
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool writeInterfacesToFileASM(const char* filename, const std::vector<InterfaceBlock>& interfaces, const std::vector<EnumBlock>& enums, const DefineBlock& defineBlock) {
|
||||
std::ofstream ofs;
|
||||
ofs.open(filename, std::ios::out);
|
||||
if (!ofs.good()) {
|
||||
LogMessage("writeLinesToFile() - could not open file %s\n", filename);
|
||||
return false;
|
||||
}
|
||||
ofs << "; " << filename << " by las/mercury" << std::endl << std::endl;
|
||||
if (std::string(filename).find("d3d11") != std::string::npos) {
|
||||
//ofs << "; " << filename << " by las/mercury" << std::endl;
|
||||
ofs << "extern _D3D11CreateDeviceAndSwapChain@48" << std::endl;
|
||||
ofs << "extern _D3DCompile@44" << std::endl;
|
||||
ofs << std::endl;
|
||||
/*
|
||||
typedef struct D3D11_TEXTURE2D_DESC
|
||||
{
|
||||
UINT Width;
|
||||
UINT Height;
|
||||
UINT MipLevels;
|
||||
UINT ArraySize;
|
||||
DXGI_FORMAT Format;
|
||||
DXGI_SAMPLE_DESC SampleDesc;
|
||||
D3D11_USAGE Usage;
|
||||
UINT BindFlags;
|
||||
UINT CPUAccessFlags;
|
||||
UINT MiscFlags;
|
||||
} D3D11_TEXTURE2D_DESC;
|
||||
*/
|
||||
std::string struc = std::string("");
|
||||
|
||||
struc += "struc D3D11_BUFFER_DESC\n"
|
||||
"\t.ByteWidth: resd 1\n"
|
||||
"\t.Usage: resd 1\n"
|
||||
"\t.BindFlags: resd 1\n"
|
||||
"\t.CPUAccessFlags: resd 1\n"
|
||||
"\t.MiscFlags: resd 1\n"
|
||||
"\t.StructureByteStride: resd 1\n"
|
||||
"endstruc\n";
|
||||
struc += "\n";
|
||||
|
||||
struc += "struc D3D11_SAMPLER_DESC\n"
|
||||
"\t.Filter: resd 1\n"
|
||||
"\t.AddressU: resd 1\n"
|
||||
"\t.AddressV: resd 1\n"
|
||||
"\t.AddressW: resd 1\n"
|
||||
"\t.MipLODBias: resd 1\n"
|
||||
"\t.MaxAnisotropy: resd 1\n"
|
||||
"\t.ComparisonFunc: resd 1\n"
|
||||
"\t.BorderColor: resd 4\n"
|
||||
"\t.MinLOD: resd 1\n"
|
||||
"\t.MaxLOD: resd 1\n"
|
||||
"endstruc\n";
|
||||
struc += "\n";
|
||||
|
||||
struc += "struc D3D11_TEXTURE2D_DESC\n"
|
||||
"\t.Width: resd 1\n"
|
||||
"\t.Height: resd 1\n"
|
||||
"\t.MipLevels: resd 1\n"
|
||||
"\t.ArraySize: resd 1\n"
|
||||
"\t.Format: resd 1\n"
|
||||
"\n"
|
||||
"\t; DXGI_SAMPLE_DESC SampleDesc\n"
|
||||
"\t.Count: resd 1\n"
|
||||
"\t.Quality: resd 1\n"
|
||||
"\n"
|
||||
"\t.Usage: resd 1\n"
|
||||
"\t.BindFlags: resd 1\n"
|
||||
"\t.CPUAccessFlags: resd 1\n"
|
||||
"\t.MiscFlags: resd 1\n"
|
||||
"endstruc\n";
|
||||
struc += "\n";
|
||||
|
||||
ofs << struc << std::endl;
|
||||
|
||||
} else if (std::string(filename).find("dxgi") != std::string::npos) {
|
||||
std::string struc = std::string(
|
||||
"struc DXGI_SWAP_CHAIN_DESC\n"
|
||||
"\t; DXGI_MODE_DESC BufferDesc\n"
|
||||
"\t.Width: resd 1\n"
|
||||
"\t.Height: resd 1\n"
|
||||
"\n"
|
||||
"\t; DXGI_RATIONAL RefreshRate\n"
|
||||
"\t.Numerator: resd 1\n"
|
||||
"\t.Denominator: resd 1\n"
|
||||
"\n"
|
||||
"\t.Format: resd 1\n"
|
||||
"\t.ScanlineOrdering: resd 1\n"
|
||||
"\t.Scaling: resd 1\n"
|
||||
"\n"
|
||||
"\t; DXGI_SAMPLE_DESC SampleDesc\n"
|
||||
"\t.Count: resd 1\n"
|
||||
"\t.Quality: resd 1\n"
|
||||
"\n"
|
||||
"\t.BufferUsage: resd 1\n"
|
||||
"\t.BufferCount: resd 1\n"
|
||||
"\t.OutputWindow: resd 1\n"
|
||||
"\t.Windowed: resd 1\n"
|
||||
"\t.SwapEffect: resd 1\n"
|
||||
"\t.Flags: resd 1\n"
|
||||
"endstruc\n");
|
||||
ofs << struc << std::endl;
|
||||
}
|
||||
|
||||
{
|
||||
uint N = enums.size();
|
||||
for (uint i = 0; i < N; ++i) {
|
||||
const EnumBlock& eb = enums[i];
|
||||
uint M = eb.enumEntries.size();
|
||||
ofs << "; " << eb.enumName << std::endl;
|
||||
for (auto &enumElement : eb.enumEntries) {
|
||||
ofs << "%define " << enumElement.first << " " << enumElement.second << std::endl;
|
||||
}
|
||||
ofs << std::endl;
|
||||
}
|
||||
ofs << std::endl;
|
||||
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
uint N = defineBlock.defines.size();
|
||||
for (uint i = 0; i < N; ++i) {
|
||||
const auto& def = defineBlock.defines[i];
|
||||
ofs << "%define " << def.first << " " << def.second << std::endl;
|
||||
}
|
||||
ofs << std::endl;
|
||||
|
||||
}
|
||||
|
||||
{
|
||||
uint N = interfaces.size();
|
||||
for (uint i = 0; i < N; ++i) {
|
||||
const InterfaceBlock& ib = interfaces[i];
|
||||
ofs << std::endl << "struc " << ib.interfaceName << std::endl;
|
||||
uint numInterfaces = ib.interfaceMethods.size();
|
||||
for (uint j = 0; j < numInterfaces; ++j) {
|
||||
ofs << "\t." << ib.interfaceMethods[j] << ": " << "resb 4" << std::endl;
|
||||
}
|
||||
ofs << "endstruc" << std::endl;
|
||||
}
|
||||
}
|
||||
ofs.close();
|
||||
return true;
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
if (argc != 3 && argc != 2) {
|
||||
fprintf(stderr, "Usage: ptxStrip in.ptx [out.ptx]\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
const char* inputFile = argv[1];
|
||||
const char* outputFile = argv[argc == 2 ? 1 : 2];
|
||||
|
||||
// Read in the source
|
||||
std::vector<SourceLine> source;
|
||||
if (!readLinesFromFile(inputFile, source)) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
if (std::string(inputFile).find("dxgi.h") != std::string::npos) {
|
||||
if (!readLinesFromFile("dxgiformat.h", source)) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
if (!readLinesFromFile("dxgitype.h", source)) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
if (std::string(inputFile).find("d3d11.h") != std::string::npos) {
|
||||
if (!readLinesFromFile("d3dcommon.h", source)) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
if (!readLinesFromFile("d3dcompiler.h", source)) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
size_t inputSize = getFileSize(inputFile);
|
||||
fprintf(stdout, "Input file size: %d bytes\n", inputSize);
|
||||
|
||||
// Find interfaces in the header file
|
||||
std::vector<InterfaceBlock> interfaces;
|
||||
std::vector<EnumBlock> enums;
|
||||
DefineBlock defineBlock;
|
||||
|
||||
parseInterfaces(source, interfaces, enums, defineBlock);
|
||||
|
||||
// Write the new *.inc
|
||||
if (!writeInterfacesToFileASM(outputFile, interfaces, enums, defineBlock)) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
size_t outputSize = getFileSize(outputFile);
|
||||
fprintf(stdout, "Output file size: %d bytes\n", outputSize);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
1
hgplus/las/framework-dx11-nasm/tools/ls.bat
Normal file
1
hgplus/las/framework-dx11-nasm/tools/ls.bat
Normal file
@@ -0,0 +1 @@
|
||||
dir
|
||||
92
hgplus/las/framework-dx11-nasm/tools/make.bat
Normal file
92
hgplus/las/framework-dx11-nasm/tools/make.bat
Normal file
@@ -0,0 +1,92 @@
|
||||
@ECHO OFF
|
||||
SETLOCAL
|
||||
|
||||
REM DEFAULT MAIN FILE %_DEFAULT%.asm
|
||||
SET _DEFAULT=b288
|
||||
REM LINKER OPTIONS
|
||||
REM SET _LIBPATH0=/LIBPATH:".\lib"
|
||||
SET _LIBPATH1=/LIBPATH:"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib"
|
||||
SET _LIBFILES0=kernel32.lib user32.lib gdi32.lib winmm.lib ntdll.lib d3d11.lib d3dcompiler.lib
|
||||
SET _SUBSYS=/SUBSYSTEM:CONSOLE
|
||||
SET _ENTRY=/ENTRY:start
|
||||
SET _SAFESEH=/SAFESEH:NO
|
||||
|
||||
REM CRINKLER OPTIONS
|
||||
SET _FAST0=/PRIORITY:NORMAL /COMPMODE:FAST /HASHSIZE:256 /HASHTRIES:10
|
||||
SET _FAST1=/ORDERTRIES:200 /UNSAFEIMPORT /REPORT:report.html
|
||||
|
||||
SET _SLOW0=/PRIORITY:NORMAL /COMPMODE:SLOW /HASHSIZE:256 /HASHTRIES:1000
|
||||
SET _SLOW1=/ORDERTRIES:1000 /UNSAFEIMPORT /REPORT:report.html
|
||||
REM MAYBE ADD /OVERRIDEALIGNMENTS:8
|
||||
REM CHECK PARAMETERS
|
||||
SET _n_=%_DEFAULT%
|
||||
|
||||
IF "%1"=="ibh" GOTO :IBH
|
||||
IF "%1"=="clean" GOTO :CLEAN
|
||||
IF "%1"=="dbg" GOTO :USEDEFAULT
|
||||
IF "%1"=="" GOTO :USEDEFAULT
|
||||
SET _n_=%1
|
||||
:USEDEFAULT
|
||||
IF "%1"=="dbg" GOTO :DBG
|
||||
IF "%2"=="" GOTO :3
|
||||
|
||||
GOTO :%2
|
||||
|
||||
:CLEAN
|
||||
call clean.bat
|
||||
del %_DEFAULT%*.exe
|
||||
GOTO :END
|
||||
|
||||
:IBH
|
||||
REM BUILD HASHTABLE FOR IBH IMPORTER
|
||||
glfnGenerator.exe ibh.glfn.in inc/ibh.ht.inc
|
||||
GOTO :end
|
||||
|
||||
:DBG
|
||||
REM DEBUG
|
||||
nasm %_n_%.asm -f win32 -dDEBUG
|
||||
link %_SUBSYS% %_ENTRY% %_SAFESEH% %_LIBPATH0% %_LIBPATH1% %_LIBFILES0% /OUT:%_n_%_debug.exe %_n_%.obj
|
||||
%_n_%_debug.exe
|
||||
GOTO :end
|
||||
|
||||
:1
|
||||
REM DEBUG BUILD
|
||||
nasm %_n_%.asm -f win32 -dDEBUG
|
||||
link %_SUBSYS% %_ENTRY% %_SAFESEH% %_LIBPATH0% %_LIBPATH1% %_LIBFILES0% /OUT:%_n_%_debug.exe %_n_%.obj
|
||||
GOTO :end
|
||||
|
||||
:2
|
||||
REM UNCOMPRESSED BUILD
|
||||
nasm %_n_%.asm -f win32
|
||||
link %_SUBSYS% %_ENTRY% %_SAFESEH% %_LIBPATH0% %_LIBPATH1% %_LIBFILES0% /OUT:%_n_%_uncompressed.exe %_n_%.obj
|
||||
GOTO :end
|
||||
|
||||
:3
|
||||
REM FAST COMPRESSED BUILD
|
||||
nasm %_n_%.asm -f win32
|
||||
crinkler /CRINKLER %_SUBSYS% %_ENTRY% %_FAST0% %_FAST1% %_LIBPATH0% %_LIBPATH1% %_LIBFILES0% /OUT:%_n_%_fast.exe %_n_%.obj
|
||||
GOTO :end
|
||||
|
||||
:4
|
||||
REM SLOW COMPRESSED BUILD
|
||||
nasm %_n_%.asm -f win32
|
||||
crinkler /CRINKLER %_SUBSYS% %_ENTRY% %_SLOW0% %_SLOW1% %_LIBPATH0% %_LIBPATH1% %_LIBFILES0% /OUT:%_n_%_slow.exe %_n_%.obj
|
||||
GOTO :end
|
||||
|
||||
:5
|
||||
REM SLOW COMPRESSED BUILD
|
||||
nasm %_n_%.asm -f win32
|
||||
crinkler /CRINKLER %_SUBSYS% %_ENTRY% %_SLOW0% %_SLOW1% %_LIBPATH0% %_LIBPATH1% %_LIBFILES0% /OUT:%_n_%.exe %_n_%.obj
|
||||
GOTO :end
|
||||
|
||||
:6
|
||||
REM FAST COMPRESSED DEBUG BUILD
|
||||
nasm %_n_%.asm -f win32 -dDEBUG
|
||||
crinkler /CRINKLER %_SUBSYS% %_ENTRY% %_FAST0% %_FAST1% %_LIBPATH0% %_LIBPATH1% %_LIBFILES0% /OUT:%_n_%_debug_fast.exe %_n_%.obj
|
||||
%_n_%_debug_fast.exe
|
||||
GOTO :end
|
||||
|
||||
:end
|
||||
|
||||
REM DISPLAY SOME SIZE INFORMATION
|
||||
dir /OS /AA %_n_%*
|
||||
954
hgplus/las/framework-dx11-nasm/tools/manual.txt
Normal file
954
hgplus/las/framework-dx11-nasm/tools/manual.txt
Normal file
@@ -0,0 +1,954 @@
|
||||
|
||||
CRINKLER - Compressing linker for Windows specialized for 4k intros
|
||||
|
||||
Aske Simon Christensen "Blueberry/Loonies"
|
||||
Rune L. H. Stubbe "Mentor/TBC"
|
||||
|
||||
Version 1.4 (January 19, 2013)
|
||||
|
||||
|
||||
|
||||
VERSION HISTORY
|
||||
---------------
|
||||
19.01.13: 1.4: Output EXE files work with recent NVIDIA drivers.
|
||||
New zero-section header layout saving around 30-50 bytes.
|
||||
Forwarded RVA imports supported via link-time forwarding.
|
||||
Dynamic C++ initializers supported.
|
||||
Support for producing Large Address Aware executables.
|
||||
Crinkler is Large Address Aware, handling larger inputs.
|
||||
Report all unresolved symbols and the location of each.
|
||||
Better resolving of ambiguous label references in report.
|
||||
Various adjustments to textual output.
|
||||
/RECOMPRESS overwrites input file by default.
|
||||
|
||||
05.03.11: 1.3: Fixed Crinkler crash on some AMD systems.
|
||||
Header size reduced by 21 bytes.
|
||||
Slightly improved model hash function.
|
||||
/OVERRIDEALIGNMENTS option to specify label alignments.
|
||||
No limit on the number of calls in call transform.
|
||||
Import code and entry point movable by section reordering.
|
||||
Fixed bug in handling of files with absolute path.
|
||||
Fixed labels in report showing up in the wrong section.
|
||||
Crinkler writes .dmp files in case of a crash.
|
||||
|
||||
05.09.09: 1.2: Output EXE files are now Windows 7 compatible.
|
||||
Output EXE files are no longer Windows 2000 compatible.
|
||||
Header size reduced by 16 bytes.
|
||||
Non-range import code is (usually) slightly smaller.
|
||||
Slightly improved section ordering estimation.
|
||||
/RECOMPRESS option to recompress Crinkler-compressed
|
||||
executables, optionally with different parameters.
|
||||
/FIX removed, as it is subsumed by /RECOMPRESS.
|
||||
|
||||
14.01.09: 1.1a: Fixed /TRUNCATEFLOATS crashing in some cases.
|
||||
Improved /ORDERTRIES estimation when call transform is used.
|
||||
Sometimes sections were misplaced in the HTML report.
|
||||
Various improvements to the HTML report.
|
||||
The /FIX option can input and output to the same file.
|
||||
Helpful error messages for various unsupported features.
|
||||
Prefer a custom entry point to a standard library one.
|
||||
New section in the manual about runtime libraries.
|
||||
|
||||
12.01.08: 1.1: Support for weak externals (virtual C++ destructors).
|
||||
Fixed compatibility with Data Execution Prevention.
|
||||
/REPORT option for a colorful HTML compression report.
|
||||
/TRUNCATEFLOATS option to mutilate float constants.
|
||||
/SAFEIMPORT is now default, disabled with /UNSAFEIMPORT.
|
||||
Slightly smaller overhead if range importing is not used.
|
||||
Fixed some problems with compressing very small files.
|
||||
/VERBOSE:FUNCTIONS removed, as it is subsumed by /REPORT.
|
||||
Remaining /VERBOSE options renamed to /PRINT.
|
||||
Maximum number of ORDERTRIES increased to 100000.
|
||||
|
||||
07.01.07: 1.0a: New /VERBOSE:FUNCTIONS options to sort the functions.
|
||||
Various verbose output fixes.
|
||||
Various crash fixes.
|
||||
A fix to the /FIX Crinkler version recognizer.
|
||||
|
||||
27.12.06: 1.0: Output EXE files are now Windows Vista compatible.
|
||||
Compression tweak for greatly improved compression ratio.
|
||||
Much faster compression.
|
||||
Automatically takes advantage of multiple processors.
|
||||
Improved Visual Studio 2005 integration.
|
||||
/COMPMODE:INSTANT option for very quick compression.
|
||||
/ORDERTRIES option to try out different section orderings.
|
||||
/SAFEIMPORT option to insert a check for nonexistent DLLs.
|
||||
/PROGRESSGUI option for a graphical progress bar.
|
||||
/REPLACEDLL option to replace one DLL with another.
|
||||
/FIX option to fix compatibility problems of older versions.
|
||||
|
||||
09.02.06: 0.4a: Fixed linker crash problem with blank member entries
|
||||
in some library files (such as glut32).
|
||||
The /PRIORITY option was not mentioned in the
|
||||
commandline usage help.
|
||||
|
||||
18.12.05: 0.4: Changed header and import code to make output EXE files
|
||||
compatible with 64-bit versions of Windows.
|
||||
Fixed a bug in the ordinal range import mechanism.
|
||||
Added a switch to control the process priority.
|
||||
Added a warning for range import of an unused DLL.
|
||||
Some more header squeezing.
|
||||
|
||||
31.10.05: 0.3: Output EXE files are now Windows 2000 compatible.
|
||||
Added a number of verbose options to output useful
|
||||
information about the program being compressed.
|
||||
Added an option for transforming function calls to
|
||||
use absolute offsets to improve compression.
|
||||
Fixed a bug in the linker regarding identically named
|
||||
sections.
|
||||
Fixed a potential crash bug in the linker.
|
||||
Various small tweaks and optimizations.
|
||||
|
||||
23.07.05: 0.2: Fixed bug in the decompressor.
|
||||
Changed the behaviour of the /CRINKLER option.
|
||||
Added timing to the progress bars.
|
||||
Some updates to the manual and usage description.
|
||||
|
||||
21.07.05: 0.1: First release.
|
||||
|
||||
|
||||
|
||||
BACKGROUND
|
||||
----------
|
||||
|
||||
Ever since the concept of size-limited demo competitions was
|
||||
introduced in the early 1990's (and before that as well), people have
|
||||
been using executable file compressors to reduce the size of their
|
||||
final executables. An executable file compressor is a program that
|
||||
takes as input an executable file and produces a new executable file
|
||||
which has the same behaviour as the original one but is (hopefully)
|
||||
smaller.
|
||||
|
||||
The usual technique employed by executable file compressors is to
|
||||
compress the contents of the executable file using some general
|
||||
purpose data compression method and prepend to this compressed data a
|
||||
small piece of code (the decompressor) which decompresses the contents
|
||||
into memory in such a way that it looks to the code as if the original
|
||||
executable file had been loaded into memory in the normal way.
|
||||
|
||||
The size of the decompressor is usually around a few hundred bytes,
|
||||
depending on the complexity of the compression method. This
|
||||
constitutes an unavoidable overhead in the compressed file, which is
|
||||
particularly evident for small files, such as 4k intros. Furthermore,
|
||||
the header of the Windows EXE file format contains a lot of
|
||||
information that needs to be there at fixed offsets in order for
|
||||
Windows to be able to load the file. The presence of these overheads
|
||||
from the header and decompressor motivated people to look for other
|
||||
means of compressing their 4k intros.
|
||||
|
||||
Until Crinkler came around, the most popular strategy for compressing
|
||||
4k intros for Windows was CAB dropping: A few simple transformations
|
||||
are performed on the executable to make it compress better (such as
|
||||
merging sections and setting unused header fields to zero), and the
|
||||
result is compressed using the Cabinet Compression tool included with
|
||||
Windows. The resulting .CAB file is renamed to have .BAT extension,
|
||||
and some commands are inserted into the file such that when the .BAT
|
||||
file is executed, it decompresses the executable to disk (using the
|
||||
Cabinet decompression command), runs the executable and then deletes
|
||||
the executable again. This saves the size of the decompression code
|
||||
(since an external program is used to do the decompression) and some
|
||||
of the size of the header (since the header can be compressed).
|
||||
|
||||
Various dropping strategies combined with other space-saving hacks
|
||||
people employed on their 4k intros (in particular import by ordinal)
|
||||
caused severe compatibility problems. More often than not, people
|
||||
who wanted to run a newly released 4k intro found that it did not
|
||||
work on their own machine. It became customary to include a
|
||||
'compatible' version in the distribution which was larger than 4k
|
||||
but worked on all machines. For a time, it seemed that the term
|
||||
'4k intro' meant '4k on the compo machine' intro.
|
||||
|
||||
The main motivation for starting the Crinkler project was the feeling
|
||||
that the existing means available for compressing 4k intros were
|
||||
unsatisfactory. We want 4k intros that are self-contained EXE
|
||||
files. We want 4k intros that are 4 kilobytes in size. Our aim for
|
||||
Crinkler is to be the cleanest, most effective and most compatible
|
||||
executable file compressor for Windows 4k intros.
|
||||
|
||||
|
||||
|
||||
COMPATIBILITY
|
||||
-------------
|
||||
|
||||
The goal of Crinkler is for the produced EXE files to be compatible
|
||||
with all widely used Windows versions and configurations. As of
|
||||
version 1.4, the EXE files produced by Crinkler are, to the best of
|
||||
our knowledge, compatible with Windows XP, Windows Vista, Windows 7
|
||||
and Windows 8, both 32 bit and 64 bit versions. They are compatible
|
||||
with Data Execution Prevention and with execution hooks that inspect
|
||||
the import or export table of launched executables (graphics drivers
|
||||
are known to do this).
|
||||
|
||||
It is not a primary goal of Crinkler to anticipate incompatibilities
|
||||
that may arise in the future as a consequence of new Windows versions,
|
||||
graphics drivers or other widespread system changes. Guaranteeing such
|
||||
compatibility would require Crinkler to follow the EXE file format
|
||||
specification to the letter, precluding most of the header hacks that
|
||||
Crinkler utilizes in order to reduce the size overhead of the EXE
|
||||
format as much as possible. Rather, we strive to continually monitor
|
||||
the compatibility situation and release a new, fixed version of
|
||||
Crinkler whenever a situation arises that affects the compatibility
|
||||
severely (such as a new, incompatible version of Windows). This has
|
||||
occurred several times already throughout the history of Crinkler.
|
||||
|
||||
Each new version of Crinkler not only produces executables that are
|
||||
compatible with the current majority of targeted systems. It also
|
||||
includes a way of fixing old Crinkler executables to have the same
|
||||
level of compatibility. See the section on recompression for more
|
||||
details on this feature.
|
||||
|
||||
This compatibility strategy ensures that intros made using Crinkler
|
||||
will continue to be accessible to their audience, even if the Windows
|
||||
EXE loader changes in an incompatible way that could not be
|
||||
anticipated at the time the intro was produced.
|
||||
|
||||
|
||||
|
||||
INTRODUCTION
|
||||
------------
|
||||
|
||||
Crinkler is a different approach to executable file compression. While
|
||||
an ordinary executable file compressor operates on the executable file
|
||||
produced by the linker from object files, Crinkler replaces the linker
|
||||
by a combined linker and compressor. The result is an EXE file which
|
||||
does not do any kind of dropping. It decompresses into memory like a
|
||||
traditional executable file compressor.
|
||||
|
||||
Crinkler employs a range of techniques to reduce the size of the
|
||||
resulting EXE file beyond what is usually obtained by using CAB
|
||||
compression:
|
||||
|
||||
- Having control over the linking step gives much more flexibility in
|
||||
the optimizations and transformations possible on the data before
|
||||
and after compression.
|
||||
|
||||
- The compression technique used by Crinkler is based on context
|
||||
modelling, which is far superior in compression ratio to the LZ
|
||||
variants used by CAB and most other compressors. The disadvantage of
|
||||
context modelling is that it is extremely slow, but this is of
|
||||
little importance when only 4 kilobytes need to be compressed. It
|
||||
also needs quite a lot of memory for decompression, but this is
|
||||
again not a problem, since the typical 4k intro uses a lot of memory
|
||||
anyway.
|
||||
|
||||
- The actual compression algorithm performs many passes over the data
|
||||
in order to optimize the internal parameters of the compressor. This
|
||||
results in slower compression, but this is usually a reasonable
|
||||
price to pay for the extra bytes gained on the file size.
|
||||
|
||||
- The contents of the executable are split into two parts - a code
|
||||
part and a data part - and each of these are compressed
|
||||
individually. This leads to better compression, as code and data are
|
||||
usually very different in structure and so do not benefit from being
|
||||
compressed together.
|
||||
|
||||
- DLL functions are imported by hash code. This is robust to
|
||||
structural changes to the DLL between different versions while being
|
||||
quite compact - only 4 bytes per imported function. For DLLs with
|
||||
fixed relative ordinals (such as opengl32), a special technique,
|
||||
ordinal range import, can be used to further reduce the number of
|
||||
hash codes needed.
|
||||
|
||||
- Much of the data in the EXE header is actually ignored by the EXE
|
||||
loader. This space is used for some of the decompression code.
|
||||
|
||||
Using Crinkler is somewhat different from using an ordinary executable
|
||||
file compressor because of the linking step. In the following
|
||||
sections, we describe its use in detail.
|
||||
|
||||
|
||||
|
||||
INSTALLATION
|
||||
------------
|
||||
|
||||
To use as a stand-alone linker, Crinkler does not need any
|
||||
installation. Simply run crinkler.exe from the commandline with
|
||||
appropriate arguments, as described in the next section.
|
||||
|
||||
However, if you are using Microsoft Visual Studio to develop your
|
||||
intro, the easiest way to use Crinkler is to run it in place of the
|
||||
normal Visual Studio linker. Crinkler has been designed as a drop-in
|
||||
replacement of the Visual Studio linker, supporting the same basic
|
||||
options. All of the options can then be set using the Visual Studio
|
||||
configuration window.
|
||||
|
||||
Unfortunately, Visual Studio does not (as of this writing) support
|
||||
replacing its linker by a different one. So what you have to do to
|
||||
make Visual Studio use Crinkler for linking is the following:
|
||||
|
||||
- Copy crinkler.exe to your project directory or to some other
|
||||
directory of your choice and rename it to link.exe. If you are using
|
||||
some other linker with a different name, such as the one used with
|
||||
the Intel C++ compiler, call it whatever the name of the linker is.
|
||||
|
||||
- For Visual Studio 2008 and older, select Tools/Options... and go to
|
||||
Projects and Solutions/VC++ Directories. For Visual Studio 2010 or
|
||||
newer, open a project, select View/Property Manager, expand a project
|
||||
and a configuration, double click on Microsoft.Cpp.Win32.user and go
|
||||
to Common Properties/VC++ Directories.
|
||||
|
||||
- At the top of the list for Executable files, add the directory where
|
||||
you placed Crinkler named link.exe, or add $(SolutionDir) to make it
|
||||
search in the project directory.
|
||||
|
||||
- In the Release configuration (or whichever configuration you want to
|
||||
enable compression), under Linker/Command Line/Additional Options,
|
||||
type in /CRINKLER, along with any other Crinkler options you want to
|
||||
set. See the next section for more details on options. Also set
|
||||
Linker/Manifest File/Generate Manifest to No and
|
||||
C/C++/Optimization/Whole Program Optimization to No.
|
||||
|
||||
If you have Visual Studio installed but want to run Crinkler from the
|
||||
commandline, the easiest way is to use the Visual Studio Command
|
||||
Prompt (available from the Start menu), since this sets up the LIB
|
||||
environment variable correctly. You can read off the value of the
|
||||
environment variables by running the 'set' command in this command
|
||||
prompt. If you are using a different command prompt, you will have to
|
||||
set up the LIB environment variable manually, or use the /LIBPATH
|
||||
option.
|
||||
|
||||
|
||||
|
||||
USAGE
|
||||
-----
|
||||
|
||||
The general form of the command line for Crinkler is:
|
||||
|
||||
CRINKLER [options] [object files] [library files] [@commandfile]
|
||||
|
||||
When running from within Visual Studio, the object files will be the
|
||||
ones generated from the sources in the project. The library files will
|
||||
be the standard set of Win32 libraries, plus any additional library
|
||||
files specified under Linker/Input/Additional Dependencies. If you are
|
||||
using a standard runtime library, such as msvcrt, you will have to
|
||||
specify this one manually. See the section on standard libraries for
|
||||
more information.
|
||||
|
||||
|
||||
The following options are compatible with the VS linker and can be set
|
||||
using switches in the Visual Studio configuration window:
|
||||
|
||||
/SUBSYSTEM:CONSOLE
|
||||
/SUBSYSTEM:WINDOWS
|
||||
(Linker/System/SubSystem)
|
||||
|
||||
Specify the Windows subsystem to use. If the subsystem is CONSOLE,
|
||||
a console window will be opened when the program starts. The
|
||||
subsystem also determines the name of the default entry point (see
|
||||
/ENTRY). The default subsystem is WINDOWS.
|
||||
|
||||
/LARGEADDRESSAWARE
|
||||
/LARGEADDRESSAWARE:NO
|
||||
(Linker/System/Enable Large Addresses)
|
||||
|
||||
Specify whether the executable is able to handle addresses above
|
||||
2 gigabytes. If this option is enabled, the executable will be able
|
||||
to allocate close to 4 gigabytes of memory.
|
||||
|
||||
/OUT:[file]
|
||||
(Linker/General/Output File)
|
||||
|
||||
Specify the name of the resulting executable file. The default
|
||||
name is out.exe.
|
||||
|
||||
/ENTRY:[symbol]
|
||||
(Linker/Advanced/Entry Point)
|
||||
|
||||
Specify the entry label in the code. The default entry label is
|
||||
mainCRTStartup for CONSOLE subsystem applications and
|
||||
WinMainCRTStartup for WINDOWS subsystem applications.
|
||||
|
||||
/LIBPATH:[path]
|
||||
(Linker/General/Additional Library Directories)
|
||||
|
||||
Add a number of directories (separated by semicolons) to the ones
|
||||
searched for library files. If a library is not found in any of
|
||||
these, the directories mentioned in the LIB environment variable
|
||||
are searched.
|
||||
|
||||
@commandfile
|
||||
|
||||
Commandline arguments will be read from the given file, as if they
|
||||
were given directly on the commandline.
|
||||
|
||||
|
||||
In addition to the above options, a number of options can be given to
|
||||
control the compression process. These can be specified under
|
||||
Linker/Command Line/Additional Options:
|
||||
|
||||
/CRINKLER
|
||||
|
||||
Enable the Crinkler compressor. If this option is disabled,
|
||||
Crinkler will search through the path for a command with the same
|
||||
name as itself, skipping itself, and pass all arguments on to this
|
||||
command instead. This will normally invoke the Visual Studio
|
||||
linker. If the name of the Crinkler executable is crinkler.exe,
|
||||
this option is enabled by default, otherwise it is disabled by
|
||||
default.
|
||||
|
||||
/RECOMPRESS
|
||||
|
||||
Decompress a Crinkler-compressed executable and recompress it
|
||||
using the given options. The resulting executable will have the
|
||||
same level of compatibility as one produced directly by the
|
||||
current version of Crinkler. See the section on compatibility for
|
||||
more information on the compatibility of Crinkler-produced
|
||||
executables.
|
||||
|
||||
When this option is specified, Crinkler takes a single file
|
||||
argument, which must be an EXE file produced by Crinkler 0.4 or
|
||||
newer.
|
||||
|
||||
See the section on recompression below for a description of the
|
||||
options that can be given to control the decompression process.
|
||||
|
||||
/PRIORITY:IDLE
|
||||
/PRIORITY:BELOWNORMAL
|
||||
/PRIORITY:NORMAL
|
||||
|
||||
Select the process priority at which Crinkler will run while
|
||||
compressing. The default priority is BELOWNORMAL. Use IDLE if you
|
||||
want Crinkler to disturb you as little as possible. Use NORMAL if
|
||||
you don't need your machine for anything else while compressing.
|
||||
|
||||
/COMPMODE:INSTANT
|
||||
/COMPMODE:FAST
|
||||
/COMPMODE:SLOW
|
||||
|
||||
Choose between three different compression modes. The FAST mode
|
||||
usually compresses in a couple of seconds, while the SLOW one can
|
||||
take up to a few minutes to complete. The slow one usually
|
||||
compresses about 10-40 bytes better on a 4k executable. Use
|
||||
INSTANT if you just want to check that your program works in
|
||||
compressed form and don't care about the size. The default
|
||||
compression mode is FAST.
|
||||
|
||||
/HASHSIZE:[memory size]
|
||||
|
||||
Specify the amount of memory the decompressor is allowed to use
|
||||
while decompressing, in megabytes. In general, the more memory the
|
||||
decompressor is allowed to use, the better the compression ratio
|
||||
will be, though only slightly. The memory requirements of the
|
||||
final executable (the size of the executable image when loaded
|
||||
into memory) will be the maximum of this value and the original
|
||||
image size. The memory will not be deallocated until the program
|
||||
terminates, and any heap allocation the program performs will add
|
||||
to this memory usage. The default value is 100, which is usually a
|
||||
good compromise.
|
||||
|
||||
/HASHTRIES:[number of retries]
|
||||
|
||||
Specify the number of different hash table sizes the compressor
|
||||
will try in order to find one with few collisions. More tries lead
|
||||
to longer compression time but slightly better compression. The
|
||||
default value is 20. Higher values rarely improve the size by more
|
||||
than a few bytes.
|
||||
|
||||
/ORDERTRIES:[number of retries]
|
||||
|
||||
Specify the number of section reordering iterations that the
|
||||
linker will try out in search for the ordering that gives the best
|
||||
compression ratio. The default is not to do any reordering.
|
||||
Specifying this option drastically increases the compression time,
|
||||
since Crinkler has to calculate the compressed size anew on every
|
||||
reordering. Usually, the size does not improve noticeably after a
|
||||
few thousand iterations.
|
||||
|
||||
/RANGE:[DLL name]
|
||||
|
||||
Import functions from the given DLL (without the .dll suffix)
|
||||
using ordinal range import. Ordinal range import imports the first
|
||||
used function by hash and the rest by ordinal relative to the
|
||||
first one. Ordinal range import is safe to use on DLLs in which
|
||||
the ordinals are fixed relative to each other, such as opengl32 or
|
||||
d3dx9_??. This option can be specified multiple times, for
|
||||
different DLLs.
|
||||
|
||||
/REPLACEDLL:[oldDLL=newDLL]
|
||||
|
||||
Whenever a function is imported from oldDLL, import it from newDLL
|
||||
instead. DLL replacement is useful when the end user might not
|
||||
have the version of the DLL that you are linking to. A typical use
|
||||
is to replace one version of d3dx9_?? by another. Only use this
|
||||
option if you know that the two DLLs are compatible. When
|
||||
REPLACEDLL and RANGE are used together, RANGE must refer to the
|
||||
new DLL.
|
||||
|
||||
/UNSAFEIMPORT
|
||||
|
||||
If the executable fails to load some DLL, it will normally pop up
|
||||
a message box with the DLL name. This option disables this check
|
||||
to save a few bytes (usually around 20). With unsafe import, the
|
||||
executable will crash if a needed DLL is not found.
|
||||
|
||||
/TRANSFORM:CALLS
|
||||
|
||||
Change the relative jump offsets in all internal call instructions
|
||||
(E8 opcode) into absolute offsets from the start of the code. This
|
||||
usually improves compression, since multiple calls to the same
|
||||
function become identical. The transformation has an overhead of
|
||||
about 20 bytes for the detransformation code, but the net savings
|
||||
on a full 4k can be as large as 50 bytes, depending on the number
|
||||
of calls in your code.
|
||||
|
||||
/NOINITIALIZERS
|
||||
|
||||
Disable the inclusion of dynamic C++ initializers. The default is
|
||||
to insert calls to each of the initializers just before the entry
|
||||
point.
|
||||
|
||||
/TRUNCATEFLOATS:[number of bits]
|
||||
|
||||
Floating point constants can take up a significant amount of space
|
||||
in an intro, and often much of this space is wasted because the
|
||||
constants have more precision than needed. Typically, many bytes
|
||||
can be saved by rounding floating point constants to "nice" values
|
||||
- that is, values where many bits in the mantissa are zero.
|
||||
However, such rounding is cumbersome, especially when the
|
||||
constants are written in decimal notation.
|
||||
|
||||
The purpose of the /TRUNCATEFLOATS option is to automate this
|
||||
rounding process. When this option is given, Crinkler tries to
|
||||
identify float and double constants and round them to the number
|
||||
of bits given (between 1 and 64). If no number is given, 64 is
|
||||
assumed.
|
||||
|
||||
Typically, object files do not contain any information about what
|
||||
data is floating point constants and what is not (though the file
|
||||
format does support such information). This means that in order to
|
||||
identify floating point constants, Crinkler has to resort to
|
||||
heuristics based on label names. These heuristics are able to
|
||||
recognize constants in code and some variables, but far from all.
|
||||
|
||||
You can tell Crinkler explicitly that some variable contains float
|
||||
data and how much it should be truncated by having the variable
|
||||
name (or label) start with tf[n]_ where [n] is the number of bits
|
||||
to truncate the constants to. The number of bits can be omitted,
|
||||
in which case the number of bits given in the argument to
|
||||
/TRUNCATEFLOATS is used. Such variables will still only be
|
||||
truncated if the /TRUNCATEFLOATS option is given. Example:
|
||||
|
||||
const float tf14_positions[] = { 0.1f, 0.35f, 0.25f };
|
||||
|
||||
This will truncate the constants in the table to 14 bits (5 bits
|
||||
of mantissa), resulting in the values 0.099609375, 0.3515625 and
|
||||
0.25, respectively. Tip: rather than changing the variable name
|
||||
and all references to it each time you want to change the
|
||||
truncation precision, use a define:
|
||||
|
||||
#define positions tf14_positions
|
||||
|
||||
Note that /TRUNCATEFLOATS is an unstable and highly experimental
|
||||
feature. Make sure to test the compressed file to verify that the
|
||||
result is acceptable. Remember to include the musician in this
|
||||
verification process. :)
|
||||
|
||||
/OVERRIDEALIGNMENTS:[bits of alignment]
|
||||
|
||||
It is often possible to improve compression by placing
|
||||
uninitialized variables at addresses divisible by high powers of
|
||||
two, since this will cause all references to these addresses to
|
||||
contain more zeros.
|
||||
|
||||
The PE file format only supports up to 13 bits of alignment
|
||||
(8192), and some tools do not even expose this support fully (for
|
||||
instance, Nasm only supports alignments up to 64). Usually, much
|
||||
higher alignments are desirable.
|
||||
|
||||
Crinkler supports explicit alignment of labels at up to one
|
||||
gigabyte (30 bits). When you specify the /OVERRIDEALIGNMENTS
|
||||
option, Crinkler will look for labels containing the string
|
||||
align[n] where [n] is the number of bits of alignment desired
|
||||
(e.g. 8 for 256-byte alignment). It will then align the section
|
||||
containing that label such that the label address is divisible by
|
||||
2^[n]. The label does not have to be at the beginning of the
|
||||
section, but there can be at most one explicitly aligned label in
|
||||
each section.
|
||||
|
||||
The alignment specifier can optionally include an alignment
|
||||
offset, specified by the string align[n]_[m] where [n] is the
|
||||
number of bits of alignment and [m] is the offset in bytes. This
|
||||
will place the label [m] bytes after an aligned address, i.e. such
|
||||
that the address minus [m] is divisible by 2^[n].
|
||||
|
||||
If a numerical argument is given to /OVERRIDEALIGNMENTS, all
|
||||
uninitialized sections which do not contain an explicitly aligned
|
||||
label will be aligned to the given number of bits (if larger than
|
||||
their original alignment). If the option is specified without
|
||||
argument, uninitialized sections which do not contain an
|
||||
explicitly aligned label will be aligned as specified in the
|
||||
object file, as normally.
|
||||
|
||||
A convenient way to specify explicit alignments in C++ code is in
|
||||
a header file included by all files in the project, containing
|
||||
definitions like this:
|
||||
|
||||
#define MusicBuffer MusicBuffer_align24
|
||||
|
||||
In assembler files, alignments can be specified as local labels:
|
||||
|
||||
MusicBuffer:
|
||||
.align24
|
||||
; buffer space here
|
||||
|
||||
Explicit alignment can be used on code and data sections as well,
|
||||
except for the section containing the entry point, which will
|
||||
always be 1-byte aligned. The space between the sections will be
|
||||
padded with zero bytes.
|
||||
|
||||
|
||||
Finally, Crinkler has a number of options for controlling the output
|
||||
during compression. Just like the other options, these can be
|
||||
specified under Linker/Command Line/Additional Options:
|
||||
|
||||
/REPORT:[HTML file name]
|
||||
|
||||
Write an HTML file with a detailed, colorful, interactive report
|
||||
on the compression result. The code section will be shown as hex
|
||||
dump and disassembly of the code, and the data section will be
|
||||
shown as hex and ascii dump. All bytes will be colored to show how
|
||||
much that byte was compressed. This report can be useful in
|
||||
determining which parts of the executable take up the most space
|
||||
and which things to change to reduce the size.
|
||||
|
||||
/PRINT:LABELS
|
||||
|
||||
Print a list of all labels in the program along with uncompressed
|
||||
and compressed sizes for the data between the labels. This is a
|
||||
stripped down version of the information provided by the /REPORT
|
||||
option.
|
||||
|
||||
/PRINT:IMPORTS
|
||||
|
||||
List all functions imported from DLLs. The functions are grouped
|
||||
by DLL, and functions imported by ordinal range import are grouped
|
||||
into ranges.
|
||||
|
||||
/PRINT:MODELS
|
||||
|
||||
List the model masks and weights selected by the compressor. This
|
||||
is mostly for internal use.
|
||||
|
||||
/PROGRESSGUI
|
||||
|
||||
Open a window showing a graphical progress indicator.
|
||||
|
||||
|
||||
An example commandline for linking and compressing an intro could look
|
||||
like this (split on multiple lines for readability):
|
||||
|
||||
crinkler.exe /OUT:micropolis.exe /SUBSYSTEM:WINDOWS /RANGE:opengl32
|
||||
/COMPMODE:SLOW /ORDERTRIES:1000 /PRINT:IMPORTS /PRINT:LABELS
|
||||
kernel32.lib user32.lib gdi32.lib opengl32.lib glu32.lib winmm.lib
|
||||
micropolis\startup.obj micropolis\render.obj
|
||||
micropolis\render-asm.obj micropolis\sound.obj
|
||||
micropolis\sound-asm.obj
|
||||
|
||||
|
||||
|
||||
RECOMPRESSION
|
||||
-------------
|
||||
|
||||
A new feature in Crinkler 1.2 is the abillity to recompress an already
|
||||
Crinkler-compressed executable. The main purpose for the feature is to
|
||||
patch an executable compressed using an earlier version of Crinkler so
|
||||
that it runs on recent Windows versions. But it can also be used
|
||||
more generally to change some of the compression parameters of a
|
||||
compressed program without performing the whole linking and
|
||||
compression process from scratch and without access to the original
|
||||
object files. Particularly, if your output executable after a long
|
||||
time spent compressing is just a few bytes too big due to bytes lost
|
||||
to hashing, you can recompress the output executable, specifying a
|
||||
higher value for /HASHSIZE and/or /HASHTRIES, and thus avoid running
|
||||
through the whole compression process again.
|
||||
|
||||
Recompression mode is activated by the /RECOMPRESS option. When this
|
||||
option is specified, Crinkler takes a single file argument, which must
|
||||
be an EXE file produced by Crinkler 0.4 or newer. Most options then
|
||||
take on slightly different meanings, as described here.
|
||||
|
||||
The /CRINKLER, /PRIORITY, @commandfile and /PROGRESSGUI options work
|
||||
as normally. The /ENTRY, /LIBPATH, /ORDERTRIES, /RANGE, /REPLACEDLL,
|
||||
/UNSAFEIMPORT, /TRANSFORM:CALLS, /NOINITIALIZERS, /TRUNCATEFLOATS and
|
||||
/OVERRIDEALIGNMENTS options are ignored, as the parameters specified
|
||||
by these options cannot be changed via recompression. The /PRINT options
|
||||
are also ignored. The remaining options work as follows:
|
||||
|
||||
/SUBSYSTEM:CONSOLE
|
||||
/SUBSYSTEM:WINDOWS
|
||||
|
||||
If this option is given, it specifies the Windows subsystem to use
|
||||
as normally. If it is omitted, the original subsystem will be
|
||||
used.
|
||||
|
||||
/LARGEADDRESSAWARE
|
||||
/LARGEADDRESSAWARE:NO
|
||||
|
||||
If this option is given, it specifies large address awareness of the
|
||||
executable as normally. If it is omitted, the original large address
|
||||
awareness will be used.
|
||||
|
||||
/OUT:[file]
|
||||
|
||||
Specify the name of the resulting executable file. The default is
|
||||
to overwrite the input file.
|
||||
|
||||
/COMPMODE:INSTANT
|
||||
/COMPMODE:FAST
|
||||
/COMPMODE:SLOW
|
||||
|
||||
If this option is specified, the compression models will be
|
||||
reestimated using the specified compression mode. If the option is
|
||||
omitted, the models used for the original compression will be used
|
||||
for the recompression, and no model estimation will be performed.
|
||||
If the executable was originally produced by Crinkler 1.0 or
|
||||
newer, this will typically yield a compression ratio similar to
|
||||
the original compression.
|
||||
|
||||
/HASHSIZE:[memory size]
|
||||
|
||||
If neither this option nor a compression mode is specified, the
|
||||
original, optimized hash size will be used. Recompression speed
|
||||
will be similar to INSTANT compression mode in this case.
|
||||
|
||||
If a compression mode is specified but this option is omitted,
|
||||
hash size optimization will be performed using the hash size
|
||||
specified for the original file.
|
||||
|
||||
If this option is given, hash size optimization takes place
|
||||
normally, using the specified maximum size.
|
||||
|
||||
/HASHTRIES:[number of retries]
|
||||
|
||||
If hash size optimization takes place, this option specifies the
|
||||
number of tries as normally. Otherwise it is ignored.
|
||||
|
||||
/REPORT:[HTML file name]
|
||||
|
||||
Writes out an HTML file as normally. Since no symbol information
|
||||
is available, this will be a plain disassembly/hex dump without
|
||||
labels or cross-linking.
|
||||
|
||||
|
||||
|
||||
STANDARD RUNTIME LIBRARIES
|
||||
--------------------------
|
||||
|
||||
Under normal circumstances, the Visual Studio compiler generates code
|
||||
that requires a C runtime library containing standard C functions and
|
||||
various support functions. These functions can either be linked in
|
||||
statically (included into the executable) or dynamically via a runtime
|
||||
DLL. For size-sensitive applications, you should always link
|
||||
dynamically, which is achieved by setting C/C++/Code
|
||||
Generation/Runtime Library to Multi-threaded DLL (/MD).
|
||||
|
||||
Note however, that the standard runtime libraries for Visual Studio
|
||||
2005 or newer will not work with Crinkler-compressed executables,
|
||||
since these runtime libraries require a manifest in the executable,
|
||||
and Crinkler does not support manifests. Furthermore, these DLLs are
|
||||
not present by default on Windows installations, so you will usually
|
||||
not want your program to be dependent on them.
|
||||
|
||||
To work around this, link to the Visual Studio 6 runtime library -
|
||||
msvcrt.dll - which is distributed with all Windows versions. This is
|
||||
done by using the Visual Studio 6 version of msvcrt.lib, which can be
|
||||
obtained thus:
|
||||
|
||||
- Download Service Pack 6 for Visual Studio 6.0 at
|
||||
http://msdn.microsoft.com/en-us/vstudio/aa718364.aspx
|
||||
- Place the downloaded self-extractor in an empty directory and run
|
||||
it, or open it using an archive tool such as WinRAR.
|
||||
- Open the VS6sp61.cab file and go to the vc98\lib directory. There
|
||||
you will find the msvcrt.lib file.
|
||||
- Rename this file to something else (such as msvcrt_old.lib) and
|
||||
place it in your project directory.
|
||||
- Add msvcrt_old.lib to the list of libraries to link to at
|
||||
Linker/Input/Additional Dependencies.
|
||||
|
||||
There are a couple of caveats to using an older runtime library than
|
||||
the compiler expects, though. With out-of-the-box compilation
|
||||
options, the Visual Studio compiler generates code that requires some
|
||||
support functions which are only present in newer runtime DLLs. To
|
||||
avoid these dependencies, set the following options under C/C++/Code
|
||||
Generation:
|
||||
|
||||
- Basic Runtime Checks: Default
|
||||
- Buffer Security Check: No (/GS-)
|
||||
|
||||
Also, do not use C++ exception handling in your code. And do not use
|
||||
STL classes, since they use exceptions all over.
|
||||
|
||||
Finally, even when using the DLL-based runtime, not all support code
|
||||
is linked dynamically. The runtime library contains an entry function
|
||||
which is included into the executable and takes care of things like
|
||||
parsing the commandline and executing dynamic initializers. The entry
|
||||
function then calls the main function.
|
||||
|
||||
The standard entry function is around half a kilobyte in size and is
|
||||
usually not needed for intro code to function properly. To avoid this
|
||||
overhead, define your own entry function, either by defining a
|
||||
function called mainCRTStartup or WinMainCRTStartup (depending on
|
||||
which Windows subsystem you use) or by using the /ENTRY option.
|
||||
|
||||
The best strategy is of course to avoid linking to a runtime DLL at
|
||||
all, assuming you can do without the functions provided by the
|
||||
standard runtime library. This will save the space for importing the
|
||||
runtime DLL.
|
||||
|
||||
To reduce the dependencies on the standard runtime DLL as much as
|
||||
possible, set the following options:
|
||||
|
||||
- C/C++/Optimization/Enable Intrinsic Functions: Yes (/Oi). This will
|
||||
cause several standard functions (mainly math, string and memory
|
||||
functions) to generate inline code rather than a function call.
|
||||
- C/C++/Code Generation/Floating Point Model: Fast (/fp:fast).
|
||||
- C/C++/Command Line: Add the option /QIfist. This will cause
|
||||
conversions from floating point to integer to use the FIST
|
||||
instruction rather than calling a conversion function. Note that
|
||||
this changes the semantics of conversions from truncation to
|
||||
round-to-nearest (unless you explicitly change the rounding mode of
|
||||
the FPU). On the other hand, it will also give a considerable speed
|
||||
boost.
|
||||
|
||||
|
||||
|
||||
RECOMMENDATIONS
|
||||
---------------
|
||||
|
||||
There are a number of things you can do as intro programmer to boost
|
||||
the compression achieved by Crinkler even further. This section
|
||||
gives some advice on these.
|
||||
|
||||
- Since much of the effectiveness of Crinkler comes from separating
|
||||
code and data into different parts of the file and compressing each
|
||||
part individually, it is important that this separation is
|
||||
possible. Mark your code and data sections as containing code and
|
||||
data, respectively, and do not put both code and data into the same
|
||||
section. See your assembler manual for information about how to do
|
||||
this. For instance, in Nasm, you can write the keyword "text" or
|
||||
"data" after the section name and give sections different names to
|
||||
prevent them from being merged by the assembler.
|
||||
|
||||
- Split both your code and your data into as many sections as
|
||||
possible. This gives Crinkler more opportunities to select the
|
||||
ordering of the sections to optimize the compression ratio.
|
||||
|
||||
- If you are using OpenGL, try using ordinal range import for
|
||||
opengl32. If you are using Direct3D, try using ordinal range import
|
||||
for d3dx9_??. This may reduce the space needed for function hash
|
||||
codes.
|
||||
|
||||
- If you are only importing functions from DLLs which are present on
|
||||
all Windows systems (d3dx9_?? is not), you can "safely" use the
|
||||
/UNSAFEIMPORT option. Run Crinkler with the /PRINT:IMPORTS option
|
||||
to check which DLLs you are importing from.
|
||||
|
||||
- Avoid large blocks of data, even if they are all zero. Use
|
||||
uninitialized (bss) sections instead. Crinkler does not cope well
|
||||
with large amounts of data. Be aware that the compressor may use an
|
||||
amount of memory up to about 4000 times the uncompressed code/data
|
||||
size (whichever is largest).
|
||||
|
||||
- When you perform detailed size comparisons, always use the SLOW
|
||||
compression mode with plenty of ORDERTRIES and compare the
|
||||
"Reestimated ideal compressed total size" values. The INSTANT and
|
||||
FAST modes are only intended for use during testing and to give a
|
||||
rough estimate of the compressed size. Also note that the
|
||||
compression is tuned for the 4k size target, so any size comparisons
|
||||
you perform on smaller files might turn out to behave differently
|
||||
when you get nearer to 4k.
|
||||
|
||||
- As a matter of good conduct, do not use UNSAFEIMPORT if you can
|
||||
spare the space, and do not set HASHSIZE higher than you need. In
|
||||
other words, if your final intro is well below the size limit,
|
||||
remove the UNSAFEIMPORT option (if you added it in the first place)
|
||||
and then lower HASHSIZE in order not to waste memory unnecessarily.
|
||||
|
||||
|
||||
|
||||
COMMON PROBLEMS, KNOWN BUGS AND LIMITATIONS
|
||||
-------------------------------------------
|
||||
|
||||
Any DLL that is needed by a program that Crinkler compresses must be
|
||||
available to Crinkler itself. If you get the error message 'Could not
|
||||
open DLL ...', it means that Crinkler needed the DLL but could not
|
||||
find it. You must place it either in the same directory as the
|
||||
Crinkler executable or somewhere in the DLL path, such as
|
||||
C:\WINDOWS\system32. Alternatively, you can use the REPLACEDLL option
|
||||
to replace it by one that is available. If you get this message for
|
||||
msvcr?? DLLs, you have a dependency on the runtime DLL you need to get
|
||||
rid of. See the section on standard libraries.
|
||||
|
||||
If you launch your Crinkler-compressed program from within Visual
|
||||
Studio, use Start Without Debugging (Ctrl+F5) rather than Start
|
||||
Debugging (F5). The debugger cannot handle Crinkler-compressed
|
||||
executables. If the program crashes, you can still attach the debugger
|
||||
in the normal way.
|
||||
|
||||
When running inside Visual Studio, the textual progress bars are not
|
||||
updated correctly, since the Visual Studio console does not flush the
|
||||
output until a newline is reached, even when explicitly flushed by the
|
||||
running program. Use the /PROGRESSGUI option to get a graphical
|
||||
progress bar.
|
||||
|
||||
The code for parsing object and library files contains only a minimum
|
||||
of sanity checks. If you pass a corrupt file to Crinkler, it will most
|
||||
likely crash.
|
||||
|
||||
The final compressed size must be less than 128k, or Crinkler will fail
|
||||
horribly. You shouldn't use it for such big files anyway.
|
||||
|
||||
|
||||
|
||||
SUPPORT
|
||||
-------
|
||||
|
||||
Try out Crinkler, and let us know what you think about it. If you have
|
||||
any problems, comments or suggestions, please write a message at the
|
||||
Pouet.net forum:
|
||||
|
||||
http://www.pouet.net/prod.php?which=18158
|
||||
|
||||
If you want to contact us directly, e.g. for sending us a file, write
|
||||
to authors@crinkler.net.
|
||||
|
||||
If Crinkler crashes, it will write two dump files named
|
||||
dump<n>_mini.dmp and dump<n>_full.dmp, where <n> is an integer making
|
||||
the file name unique. These files contain information about the
|
||||
execution state of Crinkler at the time of the crash. When reporting a
|
||||
crash, please include at least the mini dump, or, if possible, both.
|
||||
|
||||
The newest released version of Crinkler can always be found at
|
||||
http://www.crinkler.net.
|
||||
|
||||
|
||||
|
||||
ACKNOWLEDGEMENTS
|
||||
----------------
|
||||
|
||||
The compression technique used by Crinkler is much inspired by the PAQ
|
||||
compressor by Matt Mahoney.
|
||||
|
||||
The import code is loosely based on the hashed imports code by Peci.
|
||||
|
||||
The disassembly feature of the compression report uses the diStorm
|
||||
disassembler library by Gil Dabah.
|
||||
|
||||
Many thanks to all the people who have given us comments, bug reports
|
||||
and test material, in particular to Rambo, Kusma, Polaris, Gargaj,
|
||||
Frenetic, Buzzie, Shash, Auld, Minas, Skarab, Dwing, Freak5, Hunta,
|
||||
Snq, Darkblade, Abductee, iq, Las, pirx, Hitchhikr, Gloom, Zephod,
|
||||
coda, KK, XMunkki, KammutierSpule, acidbrain, xTrim, jix, SubV242,
|
||||
w23, ryg, shinmai, Decipher, xtrium, TomasRiker, smoothstep, XT95,
|
||||
NeKoFu, n3Xus, Moerder, merry, RCL, zoom, vampire7, Key-Real,
|
||||
quiller, and all the ones we have forgotten. Also thanks to Dwarf,
|
||||
Polygon7 and Gargaj for suggestions for our web design.
|
||||
|
||||
Big thanks to Rrrola for his valuable suggestions for optimizing the
|
||||
decompression code, and to qkumba for his guidance on the zero-section
|
||||
header and for tracking down the NVIDIA driver issue.
|
||||
|
||||
Our special thanks to the many people who have demonstrated the
|
||||
usefulness of Crinkler by using it for their own productions.
|
||||
|
||||
Keep it going! We greatly appreciate your feedback.
|
||||
9
hgplus/las/framework-dx11-nasm/tools/minify.bat
Normal file
9
hgplus/las/framework-dx11-nasm/tools/minify.bat
Normal file
@@ -0,0 +1,9 @@
|
||||
@echo off
|
||||
for %%i in (./gpu/*.glsl) do (
|
||||
echo ----------------
|
||||
echo Minifying %%i
|
||||
echo ----------------
|
||||
shader_minifier-1.1.2 -o ./gpu/%%~ni.mglsl -v --format none --field-names xyzw ./gpu/%%i
|
||||
echo ----------------
|
||||
@echo:
|
||||
)
|
||||
431
hgplus/las/framework-dx11-nasm/tools/nvcc.txt
Normal file
431
hgplus/las/framework-dx11-nasm/tools/nvcc.txt
Normal file
@@ -0,0 +1,431 @@
|
||||
|
||||
Usage : nvcc [options] <inputfile>
|
||||
|
||||
Options for specifying the compilation phase
|
||||
============================================
|
||||
More exactly, this option specifies up to which stage the input files must be
|
||||
compiled, according to the following compilation trajectories for different
|
||||
input file types:
|
||||
.c/.cc/.cpp/.cxx : preprocess, compile, link
|
||||
.o : link
|
||||
.i/.ii : compile, link
|
||||
.cu : preprocess, cuda frontend, ptxassemble,
|
||||
merge with host C code, compile, link
|
||||
.gpu : cicc compile into cubin
|
||||
.ptx : ptxassemble into cubin.
|
||||
|
||||
--cuda (-cuda)
|
||||
Compile all .cu input files to .cu.cpp.ii output.
|
||||
|
||||
--cubin (-cubin)
|
||||
Compile all .cu/.ptx/.gpu input files to device- only .cubin files.
|
||||
This step discards the host code for each .cu input file.
|
||||
|
||||
--fatbin(-fatbin)
|
||||
Compile all .cu/.ptx/.gpu input files to ptx or device- only .cubin
|
||||
files (depending on the values specified for options '-arch' and/or
|
||||
'-code') and place the result into the fat binary file specified with
|
||||
option -o.
|
||||
This step discards the host code for each .cu input file.
|
||||
|
||||
--ptx (-ptx)
|
||||
Compile all .cu/.gpu input files to device- only .ptx files. This step
|
||||
discards the host code for each of these input file.
|
||||
|
||||
--gpu (-gpu)
|
||||
Compile all .cu input files to device-only .gpu files. This step
|
||||
discards the host code for each .cu input file.
|
||||
|
||||
--preprocess (-E)
|
||||
Preprocess all .c/.cc/.cpp/.cxx/.cu input files.
|
||||
|
||||
--generate-dependencies (-M)
|
||||
Generate for the one .c/.cc/.cpp/.cxx/.cu input file (more than one
|
||||
input file is not allowed in this mode) a dependency file that can be
|
||||
included in a make file.
|
||||
|
||||
--compile (-c)
|
||||
Compile each .c/.cc/.cpp/.cxx/.cu input file into an object file.
|
||||
|
||||
--device-c (-dc)
|
||||
Compile each .c/.cc/.cpp/.cxx/.cu input file into an object file that
|
||||
contains relocatable device code. It is equivalent to
|
||||
'--relocatable-device-code=true --compile'.
|
||||
|
||||
--device-w (-dw)
|
||||
Compile each .c/.cc/.cpp/.cxx/.cu input file into an object file that
|
||||
contains executable device code. It is equivalent to
|
||||
'--relocatable-device-code=false --compile'.
|
||||
|
||||
--device-link (-dlink)
|
||||
Link object files with relocatable device code and .ptx/.cubin/.fatbin
|
||||
files into an object file with executable device code, which can be
|
||||
passed to the host linker.
|
||||
|
||||
--link (-link)
|
||||
This option specifies the default behavior: compile and link all inputs
|
||||
.
|
||||
|
||||
--no-device-link (-nodlink)
|
||||
Skip the device link step when linking object files.
|
||||
|
||||
--lib (-lib)
|
||||
Compile all inputs into object files (if necessary) and add the results
|
||||
to the specified output library file.
|
||||
|
||||
--run (-run)
|
||||
This option compiles and links all inputs into an executable, and
|
||||
executes it. Or, when the input is a single executable, it is executed
|
||||
without any compilation or linking. This step is intended for
|
||||
developers who do not want to be bothered with setting the necessary
|
||||
cuda dll search paths (these will be set temporarily by nvcc).
|
||||
|
||||
|
||||
File and path specifications
|
||||
============================
|
||||
|
||||
--x (-x)
|
||||
Explicitly specify the language for the input files, rather than
|
||||
letting the compiler choose a default based on the file name suffix.
|
||||
Allowed values for this option: 'c','c++','cu'.
|
||||
|
||||
--output-file <file> (-o)
|
||||
Specify name and location of the output file. Only a single input file
|
||||
is allowed when this option is present in nvcc non- linking/archiving
|
||||
mode.
|
||||
|
||||
--pre-include <include-file>,... (-include)
|
||||
Specify header files that must be preincluded during preprocessing.
|
||||
|
||||
--library <library>,... (-l)
|
||||
Specify libraries to be used in the linking stage without the library
|
||||
file extension. The libraries are searched for on the library search
|
||||
paths that have been specified using option '-L'.
|
||||
|
||||
--define-macro <macrodef>,... (-D)
|
||||
Specify macro definitions to define for use during preprocessing or
|
||||
compilation.
|
||||
|
||||
--undefine-macro <macrodef>,... (-U)
|
||||
Specify macro definitions to undefine for use during preprocessing or
|
||||
compilation.
|
||||
|
||||
--include-path <include-path>,... (-I)
|
||||
Specify include search paths.
|
||||
|
||||
--system-include <include-path>,... (-isystem)
|
||||
Specify system include search paths.
|
||||
|
||||
--library-path <library-path>,... (-L)
|
||||
Specify library search paths.
|
||||
|
||||
--output-directory <directory> (-odir)
|
||||
Specify the directory of the output file. This option is intended for
|
||||
letting the dependency generation step (option
|
||||
'--generate-dependencies') generate a rule that defines the target
|
||||
object file in the proper directory.
|
||||
|
||||
--compiler-bindir <path> (-ccbin)
|
||||
Specify the directory in which the compiler executable (Microsoft
|
||||
Visual Studio cl, or a gcc derivative) resides. By default, this
|
||||
executable is expected in the current executable search path. For a
|
||||
different compiler, or to specify these compilers with a different
|
||||
executable name, specify the path to the compiler including the
|
||||
executable name.
|
||||
|
||||
--cudart(-cudart)
|
||||
Specify the type of CUDA runtime library to be used: static CUDA
|
||||
runtime library, shared/dynamic CUDA runtime library, or no CUDA
|
||||
runtime library. By default, the static CUDA runtime library is used.
|
||||
Allowed values for this option: 'none','shared','static'.
|
||||
Default value: 'static'.
|
||||
|
||||
--cl-version <cl-version-number> --cl-version <cl-version-number>
|
||||
Specify the version of Microsoft Visual Studio installation. Note: this
|
||||
option is to be used in conjunction with '--use-local-env', and is
|
||||
ignored when '--use-local-env' is not specified.
|
||||
Allowed values for this option: 2008,2010,2012.
|
||||
|
||||
--use-local-env --use-local-env
|
||||
Specify whether the environment is already set up for the host compiler
|
||||
.
|
||||
|
||||
--libdevice-directory <directory> (-ldir)
|
||||
Specify the directory that contains the libdevice library files when
|
||||
option '--dont-use-profile' is used. Libdevice library files are
|
||||
located in the 'nvvm/libdevice' directory in the CUDA toolkit.
|
||||
|
||||
|
||||
Options for specifying behaviour of compiler/linker
|
||||
===================================================
|
||||
|
||||
--profile (-pg)
|
||||
Instrument generated code/executable for use by gprof (Linux only).
|
||||
|
||||
--debug (-g)
|
||||
Generate debug information for host code.
|
||||
|
||||
--device-debug (-G)
|
||||
Generate debug information for device code.
|
||||
|
||||
--generate-line-info (-lineinfo)
|
||||
Generate line-number information for device code.
|
||||
|
||||
--optimize <level> (-O)
|
||||
Specify optimization level for host code.
|
||||
|
||||
--shared(-shared)
|
||||
Generate a shared library during linking. Note: when other linker
|
||||
options are required for controlling dll generation, use option
|
||||
-Xlinker.
|
||||
|
||||
--machine <bits> (-m)
|
||||
Specify 32 vs 64 bit architecture.
|
||||
Allowed values for this option: 32,64.
|
||||
Default value: 64.
|
||||
|
||||
|
||||
Options for passing specific phase options
|
||||
==========================================
|
||||
These allow for passing options directly to the intended compilation phase.
|
||||
Using these, users have the ability to pass options to the lower level
|
||||
compilation tools, without the need for nvcc to know about each and every such
|
||||
option.
|
||||
|
||||
--compiler-options <options>,... (-Xcompiler)
|
||||
Specify options directly to the compiler/preprocessor.
|
||||
|
||||
--linker-options <options>,... (-Xlinker)
|
||||
Specify options directly to the host linker.
|
||||
|
||||
--archive-options <options>,... (-Xarchive)
|
||||
Specify options directly to library manager.
|
||||
|
||||
--cudafe-options <options>,... (-Xcudafe)
|
||||
Specify options directly to cudafe.
|
||||
|
||||
--ptxas-options <options>,... (-Xptxas)
|
||||
Specify options directly to the ptx optimizing assembler.
|
||||
|
||||
--nvlink-options <options>,... (-Xnvlink)
|
||||
Specify options directly to nvlink.
|
||||
|
||||
|
||||
Miscellaneous options for guiding the compiler driver
|
||||
=====================================================
|
||||
|
||||
--dont-use-profile (-noprof)
|
||||
Nvcc uses the nvcc.profiles file for compilation. When specifying this
|
||||
option, the profile file is not used.
|
||||
|
||||
--dryrun(-dryrun)
|
||||
Do not execute the compilation commands generated by nvcc. Instead,
|
||||
list them.
|
||||
|
||||
--verbose (-v)
|
||||
List the compilation commands generated by this compiler driver, but do
|
||||
not suppress their execution.
|
||||
|
||||
--keep (-keep)
|
||||
Keep all intermediate files that are generated during internal
|
||||
compilation steps.
|
||||
|
||||
--keep-dir (-keep-dir)
|
||||
Keep all intermediate files that are generated during internal
|
||||
compilation steps in this directory.
|
||||
|
||||
--save-temps (-save-temps)
|
||||
This option is an alias of '--keep'.
|
||||
|
||||
--clean-targets (-clean)
|
||||
This option reverses the behaviour of nvcc. When specified, none of the
|
||||
compilation phases will be executed. Instead, all of the non- temporary
|
||||
files that nvcc would otherwise create will be deleted.
|
||||
|
||||
--run-args <arguments>,... (-run-args)
|
||||
Used in combination with option -R, to specify command line arguments
|
||||
for the executable.
|
||||
|
||||
--input-drive-prefix <prefix> (-idp)
|
||||
On Windows platforms, all command line arguments that refer to file
|
||||
names must be converted to Windows native format before they are passed
|
||||
to pure Windows executables. This option specifies how the 'current'
|
||||
development environment represents absolute paths. Use '-idp /cygwin/'
|
||||
for CygWin build environments, and '-idp /' for Mingw.
|
||||
|
||||
--dependency-drive-prefix <prefix> (-ddp)
|
||||
On Windows platforms, when generating dependency files (option -M), all
|
||||
file names must be converted to whatever the used instance of 'make'
|
||||
will recognize. Some instances of 'make' have trouble with the colon in
|
||||
absolute paths in native Windows format, which depends on the
|
||||
environment in which this 'make' instance has been compiled. Use '-ddp
|
||||
/cygwin/' for a CygWin make, and '-ddp /' for Mingw. Or leave these
|
||||
file names in native Windows format by specifying nothing.
|
||||
|
||||
--dependency-target-name <target> (-MT)
|
||||
Specify the target name of the generated rule when generating a
|
||||
dependency file (option -M).
|
||||
|
||||
--drive-prefix <prefix> (-dp)
|
||||
Specifies <prefix> as both input-drive-prefix and
|
||||
dependency-drive-prefix.
|
||||
|
||||
--no-align-double --no-align-double
|
||||
Specifies that -malign-double should not be passed as a compiler
|
||||
argument on 32-bit platforms. WARNING: this makes the ABI incompatible
|
||||
with the cuda's kernel ABI for certain 64-bit types.
|
||||
|
||||
|
||||
Options for steering GPU code generation
|
||||
========================================
|
||||
|
||||
--gpu-architecture <gpu architecture name> (-arch)
|
||||
Specify the name of the class of nVidia GPU architectures for which the
|
||||
cuda input files must be compiled.
|
||||
With the exception as described for the shorthand below, the
|
||||
architecture specified with this option must be a virtual architecture
|
||||
(such as compute_10), and it will be the assumed architecture during
|
||||
the cicc compilation stage.
|
||||
This option will cause no code to be generated (that is the role of
|
||||
nvcc option '--gpu-code', see below); rather, its purpose is to steer
|
||||
the cicc stage, influencing the architecture of the generated ptx
|
||||
intermediate.
|
||||
For convenience in case of simple nvcc compilations the following
|
||||
shorthand is supported: if no value for option '--gpu-code' is
|
||||
specified, then the value of this option defaults to the value of
|
||||
'--gpu-architecture'. In this situation, as only exception to the
|
||||
description above, the value specified for '--gpu-architecture' may be
|
||||
a 'real' architecture (such as a sm_13), in which case nvcc uses the
|
||||
specified real architecture and its closest virtual architecture as
|
||||
effective architecture values. For example, 'nvcc -arch=sm_13' is
|
||||
equivalent to 'nvcc -arch=compute_13 -code=sm_13,compute_13'.
|
||||
Allowed values for this option: 'compute_10','compute_11','compute_12',
|
||||
'compute_13','compute_20','compute_30','compute_35','sm_10','sm_11',
|
||||
'sm_12','sm_13','sm_20','sm_21','sm_30','sm_35'.
|
||||
|
||||
--gpu-code <gpu architecture name>,... (-code)
|
||||
Specify the names of nVidia gpus to generate code for.
|
||||
nvcc will embed a compiled code image in the resulting executable for
|
||||
each specified 'code' architecture. This code image will be a true
|
||||
binary load image for each 'real' architecture (such as a sm_13), and
|
||||
ptx intermediate code for each virtual architecture (such as
|
||||
compute_10). During runtime, in case no better binary load image is
|
||||
found, and provided that the ptx architecture is compatible with the
|
||||
'current' GPU, such embedded ptx code will be dynamically translated
|
||||
for this current GPU by the cuda runtime system.
|
||||
Architectures specified for this option can be virtual as well as real,
|
||||
but each of these 'code' architectures must be compatible with the
|
||||
architecture specified with option '--gpu-architecture'.
|
||||
For instance, 'arch'=compute_13 is not compatible with 'code'=sm_10,
|
||||
because the generated ptx code will assume the availability of
|
||||
compute_13 features that are not present on sm_10.
|
||||
Allowed values for this option: 'compute_10','compute_11','compute_12',
|
||||
'compute_13','compute_20','compute_30','compute_35','sm_10','sm_11',
|
||||
'sm_12','sm_13','sm_20','sm_21','sm_30','sm_35'.
|
||||
|
||||
--generate-code (-gencode)
|
||||
This option provides a generalization of the '--gpu-architecture=<arch>
|
||||
--gpu-code=code,...' option combination for specifying nvcc behavior
|
||||
with respect to code generation. Where use of the previous options
|
||||
generates different code for a fixed virtual architecture, option
|
||||
'--generate-code' allows multiple cicc invocations, iterating over
|
||||
different virtual architectures. In fact,
|
||||
'--gpu-architecture=<arch> --gpu-code=<code>,...'
|
||||
is equivalent to
|
||||
'--generate-code arch=<arch>,code=<code>,...'.
|
||||
'--generate-code' options may be repeated for different virtual
|
||||
architectures.
|
||||
Allowed keywords for this option: 'arch','code'.
|
||||
|
||||
--maxrregcount <N> (-maxrregcount)
|
||||
Specify the maximum amount of registers that GPU functions can use.
|
||||
Until a function- specific limit, a higher value will generally
|
||||
increase the performance of individual GPU threads that execute this
|
||||
function. However, because thread registers are allocated from a global
|
||||
register pool on each GPU, a higher value of this option will also
|
||||
reduce the maximum thread block size, thereby reducing the amount of
|
||||
thread parallelism. Hence, a good maxrregcount value is the result of a
|
||||
trade-off.
|
||||
If this option is not specified, then no maximum is assumed.
|
||||
Value less than the minimum registers required by ABI will be bumped up
|
||||
by the compiler to ABI minimum limit.
|
||||
|
||||
--ftz [true,false] (-ftz)
|
||||
When performing single-precision floating-point operations, flush
|
||||
denormal values to zero or preserve denormal values. -use_fast_math
|
||||
implies --ftz=true.
|
||||
Default value: 0.
|
||||
|
||||
--prec-div [true,false] (-prec-div)
|
||||
For single-precision floating-point division and reciprocals, use IEEE
|
||||
round-to-nearest mode or use a faster approximation. -use_fast_math
|
||||
implies --prec-div=false.
|
||||
Default value: 1.
|
||||
|
||||
--prec-sqrt [true,false] (-prec-sqrt)
|
||||
For single-precision floating-point square root, use IEEE
|
||||
round-to-nearest mode or use a faster approximation. -use_fast_math
|
||||
implies --prec-sqrt=false.
|
||||
Default value: 1.
|
||||
|
||||
--fmad [true,false] (-fmad)
|
||||
Enables (disables) the contraction of floating-point multiplies and
|
||||
adds/subtracts into floating-point multiply-add operations (FMAD, FFMA,
|
||||
or DFMA). This option is supported only when '--gpu-architecture' is
|
||||
set with compute_20, sm_20, or higher. For other architecture classes,
|
||||
the contraction is always enabled. -use_fast_math implies --fmad=true.
|
||||
Default value: 1.
|
||||
|
||||
--relocatable-device-code [true,false] (-rdc)
|
||||
Enable (disable) the generation of relocatable device code. If
|
||||
disabled, executable device code is generated.
|
||||
Default value: 0.
|
||||
|
||||
|
||||
Options for steering cuda compilation
|
||||
=====================================
|
||||
|
||||
--use_fast_math (-use_fast_math)
|
||||
Make use of fast math library. -use_fast_math implies -ftz=true
|
||||
-prec-div=false -prec-sqrt=false.
|
||||
|
||||
--entries entry,... (-e)
|
||||
In case of compilation of ptx or gpu files to cubin: specify the global
|
||||
entry functions for which code must be generated. By default, code will
|
||||
be generated for all entry functions.
|
||||
|
||||
|
||||
Generic tool options
|
||||
====================
|
||||
|
||||
--disable-warnings (-w)
|
||||
Inhibit all warning messages.
|
||||
|
||||
--source-in-ptx (-src-in-ptx)
|
||||
Interleave source in ptx.
|
||||
|
||||
--restrict (-restrict)
|
||||
Programmer assertion that all kernel pointer parameters are restrict
|
||||
pointers.
|
||||
|
||||
--Werror<kind>,... (-Werror)
|
||||
Make warnings of the specified kinds into errors. The following is the
|
||||
list of warning kinds accepted by this option:
|
||||
|
||||
cross-execution-space-call
|
||||
Be more strict about unsupported cross execution space calls.
|
||||
The compiler will generate an error instead of a warning for a
|
||||
call from a __host__ __device__ to a __host__ function.
|
||||
|
||||
Allowed values for this option: 'cross-execution-space-call'.
|
||||
|
||||
--help (-h)
|
||||
Print this help information on this tool.
|
||||
|
||||
--version (-V)
|
||||
Print version information on this tool.
|
||||
|
||||
--options-file <file>,... (-optf)
|
||||
Include command line options from specified file.
|
||||
|
||||
|
||||
BIN
hgplus/las/framework-dx11-nasm/tools/shader_minifier-1.1.1.exe
Normal file
BIN
hgplus/las/framework-dx11-nasm/tools/shader_minifier-1.1.1.exe
Normal file
Binary file not shown.
BIN
hgplus/las/framework-dx11-nasm/tools/shader_minifier-1.1.2.exe
Normal file
BIN
hgplus/las/framework-dx11-nasm/tools/shader_minifier-1.1.2.exe
Normal file
Binary file not shown.
22
hgplus/las/framework-dx11/framework-dx11.sln
Normal file
22
hgplus/las/framework-dx11/framework-dx11.sln
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.21005.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "framework-dx11", "framework-dx11.vcxproj", "{5D25DE85-C37F-4D88-B675-E000CF62FD9F}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{5D25DE85-C37F-4D88-B675-E000CF62FD9F}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{5D25DE85-C37F-4D88-B675-E000CF62FD9F}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{5D25DE85-C37F-4D88-B675-E000CF62FD9F}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{5D25DE85-C37F-4D88-B675-E000CF62FD9F}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
99
hgplus/las/framework-dx11/framework-dx11.vcxproj
Normal file
99
hgplus/las/framework-dx11/framework-dx11.vcxproj
Normal file
@@ -0,0 +1,99 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{5D25DE85-C37F-4D88-B675-E000CF62FD9F}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>frameworkdx11</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;d3d11.lib;d3dcompiler.lib</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExceptionHandling>false</ExceptionHandling>
|
||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;d3d11.lib;d3dcompiler.lib</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<FxCompile Include="test.hlsl">
|
||||
<EntryPointName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">csLensDirt</EntryPointName>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">5.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Compute</ShaderType>
|
||||
<EntryPointName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">csStreaks</EntryPointName>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">5.0</ShaderModel>
|
||||
</FxCompile>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
258
hgplus/las/framework-dx11/main.cpp
Normal file
258
hgplus/las/framework-dx11/main.cpp
Normal file
@@ -0,0 +1,258 @@
|
||||
#define VC_EXTRALEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <Windows.h>
|
||||
#include <cstdlib>
|
||||
|
||||
#define D3D11_NO_HELPERS
|
||||
#include <d3d11.h>
|
||||
#include <dxgi.h>
|
||||
#include <d3dcompiler.h>
|
||||
|
||||
#define ATOM_EDIT 0xC018
|
||||
#define ATOM_STATIC 0xC019
|
||||
|
||||
#define WIDTH 1280
|
||||
#define HEIGHT 720
|
||||
#define _FULLSCREEN
|
||||
|
||||
HWND hWnd;
|
||||
|
||||
typedef struct {
|
||||
// DXGI_MODE_DESC BufferDesc;
|
||||
UINT Width;
|
||||
UINT Height;
|
||||
//DXGI_RATIONAL RefreshRate;
|
||||
UINT Numerator;
|
||||
UINT Denominator;
|
||||
DXGI_FORMAT Format;
|
||||
DXGI_MODE_SCANLINE_ORDER ScanlineOrdering;
|
||||
DXGI_MODE_SCALING Scaling;
|
||||
|
||||
// DXGI_SAMPLE_DESC SampleDesc;
|
||||
UINT Count;
|
||||
UINT Quality;
|
||||
|
||||
DXGI_USAGE BufferUsage;
|
||||
UINT BufferCount;
|
||||
HWND OutputWindow;
|
||||
BOOL Windowed;
|
||||
DXGI_SWAP_EFFECT SwapEffect;
|
||||
UINT Flags;
|
||||
} HG_DXGI_SWAP_CHAIN_DESC;
|
||||
|
||||
#ifdef FULLSCREEN
|
||||
HG_DXGI_SWAP_CHAIN_DESC swapChainDesc = {
|
||||
WIDTH, HEIGHT, 0, 1, DXGI_FORMAT_R16G16B16A16_FLOAT,
|
||||
DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED, DXGI_MODE_SCALING_UNSPECIFIED,
|
||||
1, 0, DXGI_USAGE_RENDER_TARGET_OUTPUT | DXGI_USAGE_UNORDERED_ACCESS | DXGI_USAGE_SHADER_INPUT, 1, 0, 0, DXGI_SWAP_EFFECT_DISCARD, 0
|
||||
};
|
||||
#else
|
||||
HG_DXGI_SWAP_CHAIN_DESC swapChainDesc = {
|
||||
WIDTH, HEIGHT, 0, 1, DXGI_FORMAT_R16G16B16A16_FLOAT,
|
||||
DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED, DXGI_MODE_SCALING_UNSPECIFIED,
|
||||
1, 0, DXGI_USAGE_RENDER_TARGET_OUTPUT | DXGI_USAGE_UNORDERED_ACCESS | DXGI_USAGE_SHADER_INPUT, 1, 0, -1, DXGI_SWAP_EFFECT_DISCARD, 0
|
||||
};
|
||||
#endif
|
||||
|
||||
ID3D11Device* device;
|
||||
ID3D11DeviceContext* context;
|
||||
IDXGISwapChain* swapChain;
|
||||
ID3D11Texture2D* backBufferTexture;
|
||||
//ID3D11RenderTargetView* renderTargetView;
|
||||
ID3D11UnorderedAccessView* backBufferUAV;
|
||||
|
||||
struct TEXTURE_2D_SRV_UAV_RTV {
|
||||
ID3D11Texture2D* TEX;
|
||||
ID3D11ShaderResourceView* SRV;
|
||||
ID3D11UnorderedAccessView* UAV;
|
||||
ID3D11RenderTargetView* RTV;
|
||||
};
|
||||
|
||||
void createSRVUAVRTV(TEXTURE_2D_SRV_UAV_RTV* tex, int width, int height) {
|
||||
static D3D11_TEXTURE2D_DESC texDesc = {
|
||||
width, height, 0, 1, DXGI_FORMAT_R16G16B16A16_FLOAT,
|
||||
{1, 0}, D3D11_USAGE_DEFAULT,
|
||||
D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_UNORDERED_ACCESS,
|
||||
0, D3D11_RESOURCE_MISC_GENERATE_MIPS
|
||||
};
|
||||
device->CreateTexture2D(&texDesc, NULL, &tex->TEX);
|
||||
device->CreateShaderResourceView(tex->TEX, NULL, &tex->SRV);
|
||||
device->CreateUnorderedAccessView(tex->TEX, NULL, &tex->UAV);
|
||||
device->CreateRenderTargetView(tex->TEX, NULL, &tex->RTV);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
#ifdef FULLSCREEN
|
||||
ShowCursor(0);
|
||||
HWND hWnd = CreateWindowExA(0, (LPCSTR)ATOM_STATIC, 0, WS_POPUP | WS_VISIBLE | WS_MAXIMIZE, 0, 0, WIDTH, HEIGHT, 0, 0, 0, 0);
|
||||
//ShowWindow(hWnd, SW_SHOW);
|
||||
#else
|
||||
HWND hWnd = CreateWindowExA(WS_EX_TOPMOST, (LPCSTR)ATOM_STATIC, 0, WS_POPUP | WS_VISIBLE, 0, 0, WIDTH, HEIGHT, 0, 0, 0, 0);
|
||||
#endif
|
||||
//ShowWindow(hWnd, SW_SHOW);
|
||||
|
||||
swapChainDesc.OutputWindow = hWnd;
|
||||
D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, D3D11_CREATE_DEVICE_DEBUG, NULL, 0, D3D11_SDK_VERSION, (DXGI_SWAP_CHAIN_DESC*)&swapChainDesc, &swapChain, &device, NULL, &context);
|
||||
swapChain->GetBuffer(0, __uuidof(ID3D11Texture2D), (LPVOID*)&backBufferTexture);
|
||||
device->CreateUnorderedAccessView(backBufferTexture, NULL, &backBufferUAV);
|
||||
|
||||
const char src[] =
|
||||
"RWTexture2D<float4> o0:register(u0);\n"
|
||||
"[numthreads(16,16,1)]\n"
|
||||
"void cs(uint3 id:SV_DispatchThreadID) {\n"
|
||||
"o0[id.xy]=float4(1,id.xy/float2(1280,720),1);\n"
|
||||
"}"
|
||||
;
|
||||
|
||||
ID3DBlob* blob;
|
||||
ID3DBlob* errorBlob;
|
||||
|
||||
//if (D3DCompile(src, sizeof(src), NULL, NULL, NULL, "cs", "cs_5_0", D3DCOMPILE_OPTIMIZATION_LEVEL3, 0, &blob, &errorBlob)) {
|
||||
// MessageBoxA(0, (char*)errorBlob->GetBufferPointer(), "ERROR", MB_OK | MB_ICONERROR);
|
||||
// return EXIT_FAILURE;
|
||||
//}
|
||||
|
||||
if (D3DCompileFromFile(L"test.hlsl", NULL, NULL, "csRaytrace", "cs_5_0", D3DCOMPILE_OPTIMIZATION_LEVEL3, 0, &blob, &errorBlob)) {
|
||||
MessageBoxA(0, (char*)errorBlob->GetBufferPointer(), "ERROR", MB_OK | MB_ICONERROR);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
ID3D11ComputeShader* csRaytrace;
|
||||
device->CreateComputeShader(blob->GetBufferPointer(), blob->GetBufferSize(), 0, &csRaytrace);
|
||||
|
||||
if (D3DCompileFromFile(L"test.hlsl", NULL, NULL, "csLensDirt", "cs_5_0", D3DCOMPILE_OPTIMIZATION_LEVEL3, 0, &blob, &errorBlob)) {
|
||||
MessageBoxA(0, (char*)errorBlob->GetBufferPointer(), "ERROR", MB_OK | MB_ICONERROR);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
ID3D11ComputeShader* csLensDirt;
|
||||
device->CreateComputeShader(blob->GetBufferPointer(), blob->GetBufferSize(), 0, &csLensDirt);
|
||||
|
||||
if (D3DCompileFromFile(L"test.hlsl", NULL, NULL, "csStreaks", "cs_5_0", D3DCOMPILE_OPTIMIZATION_LEVEL3, 0, &blob, &errorBlob)) {
|
||||
MessageBoxA(0, (char*)errorBlob->GetBufferPointer(), "ERROR", MB_OK | MB_ICONERROR);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
ID3D11ComputeShader* csStreaks;
|
||||
device->CreateComputeShader(blob->GetBufferPointer(), blob->GetBufferSize(), 0, &csStreaks);
|
||||
|
||||
if (D3DCompileFromFile(L"test.hlsl", NULL, NULL, "csBlurH", "cs_5_0", D3DCOMPILE_OPTIMIZATION_LEVEL3, 0, &blob, &errorBlob)) {
|
||||
MessageBoxA(0, (char*)errorBlob->GetBufferPointer(), "ERROR", MB_OK | MB_ICONERROR);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
ID3D11ComputeShader* csBlurH;
|
||||
device->CreateComputeShader(blob->GetBufferPointer(), blob->GetBufferSize(), 0, &csBlurH);
|
||||
|
||||
if (D3DCompileFromFile(L"test.hlsl", NULL, NULL, "csBlurV", "cs_5_0", D3DCOMPILE_OPTIMIZATION_LEVEL3, 0, &blob, &errorBlob)) {
|
||||
MessageBoxA(0, (char*)errorBlob->GetBufferPointer(), "ERROR", MB_OK | MB_ICONERROR);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
ID3D11ComputeShader* csBlurV;
|
||||
device->CreateComputeShader(blob->GetBufferPointer(), blob->GetBufferSize(), 0, &csBlurV);
|
||||
|
||||
if (D3DCompileFromFile(L"test.hlsl", NULL, NULL, "csBokehPreprocess", "cs_5_0", D3DCOMPILE_OPTIMIZATION_LEVEL3, 0, &blob, &errorBlob)) {
|
||||
MessageBoxA(0, (char*)errorBlob->GetBufferPointer(), "ERROR", MB_OK | MB_ICONERROR);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
ID3D11ComputeShader* csBokehPreprocess;
|
||||
device->CreateComputeShader(blob->GetBufferPointer(), blob->GetBufferSize(), 0, &csBokehPreprocess);
|
||||
|
||||
if (D3DCompileFromFile(L"test.hlsl", NULL, NULL, "csBokehFirst", "cs_5_0", D3DCOMPILE_OPTIMIZATION_LEVEL3, 0, &blob, &errorBlob)) {
|
||||
MessageBoxA(0, (char*)errorBlob->GetBufferPointer(), "ERROR", MB_OK | MB_ICONERROR);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
ID3D11ComputeShader* csBokehFirst;
|
||||
device->CreateComputeShader(blob->GetBufferPointer(), blob->GetBufferSize(), 0, &csBokehFirst);
|
||||
|
||||
if (D3DCompileFromFile(L"test.hlsl", NULL, NULL, "csBokehSecond", "cs_5_0", D3DCOMPILE_OPTIMIZATION_LEVEL3, 0, &blob, &errorBlob)) {
|
||||
MessageBoxA(0, (char*)errorBlob->GetBufferPointer(), "ERROR", MB_OK | MB_ICONERROR);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
ID3D11ComputeShader* csBokehSecond;
|
||||
device->CreateComputeShader(blob->GetBufferPointer(), blob->GetBufferSize(), 0, &csBokehSecond);
|
||||
|
||||
if (D3DCompileFromFile(L"test.hlsl", NULL, NULL, "csTestScene", "cs_5_0", D3DCOMPILE_OPTIMIZATION_LEVEL0, 0, &blob, &errorBlob)) {
|
||||
MessageBoxA(0, (char*)errorBlob->GetBufferPointer(), "ERROR", MB_OK | MB_ICONERROR);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
ID3D11ComputeShader* csTestScene;
|
||||
device->CreateComputeShader(blob->GetBufferPointer(), blob->GetBufferSize(), 0, &csTestScene);
|
||||
|
||||
if (D3DCompileFromFile(L"test.hlsl", NULL, NULL, "csRadialCircumferentialBlur", "cs_5_0", D3DCOMPILE_OPTIMIZATION_LEVEL0, 0, &blob, &errorBlob)) {
|
||||
MessageBoxA(0, (char*)errorBlob->GetBufferPointer(), "ERROR", MB_OK | MB_ICONERROR);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
ID3D11ComputeShader* csRadialCircumferentialBlur;
|
||||
device->CreateComputeShader(blob->GetBufferPointer(), blob->GetBufferSize(), 0, &csRadialCircumferentialBlur);
|
||||
|
||||
TEXTURE_2D_SRV_UAV_RTV tex0, tex1, tex2, tex3, tex4;
|
||||
createSRVUAVRTV(&tex0, 1280, 720);
|
||||
createSRVUAVRTV(&tex1, 1280, 720);
|
||||
createSRVUAVRTV(&tex2, 1280, 720);
|
||||
createSRVUAVRTV(&tex3, 1280, 720);
|
||||
|
||||
D3D11_SAMPLER_DESC samplerDesc = {
|
||||
D3D11_FILTER_MIN_MAG_MIP_LINEAR, //D3D11_FILTER_MIN_MAG_MIP_LINEAR, D3D11_FILTER_ANISOTROPIC
|
||||
D3D11_TEXTURE_ADDRESS_CLAMP,
|
||||
D3D11_TEXTURE_ADDRESS_CLAMP,
|
||||
D3D11_TEXTURE_ADDRESS_CLAMP,
|
||||
0.0f,
|
||||
1,
|
||||
D3D11_COMPARISON_ALWAYS,
|
||||
{0,0,0,0},
|
||||
0,
|
||||
D3D11_FLOAT32_MAX
|
||||
};
|
||||
|
||||
ID3D11SamplerState* sampler;
|
||||
device->CreateSamplerState(&samplerDesc, &sampler);
|
||||
context->CSSetSamplers(0, 1, &sampler);
|
||||
|
||||
do {
|
||||
//context->CSSetUnorderedAccessViews(0, 1, &backBufferUAV, NULL);
|
||||
context->CSSetUnorderedAccessViews(0, 1, &tex3.UAV, NULL);
|
||||
context->CSSetShader(csLensDirt, NULL, 0);
|
||||
context->Dispatch(80, 45, 1);
|
||||
|
||||
if (0) {
|
||||
context->CSSetUnorderedAccessViews(0, 1, &tex0.UAV, NULL);
|
||||
context->CSSetShaderResources(0, 1, &tex3.SRV);
|
||||
context->CSSetShader(csBokehPreprocess, NULL, 0);
|
||||
context->Dispatch(80, 45, 1);
|
||||
|
||||
ID3D11UnorderedAccessView* bokehFirstUAV[] = {tex1.UAV, tex2.UAV};
|
||||
ID3D11ShaderResourceView* bokehFirstSRV[] = {tex0.SRV};
|
||||
context->CSSetUnorderedAccessViews(0, 2, bokehFirstUAV, NULL);
|
||||
context->CSSetShaderResources(0, 1, bokehFirstSRV);
|
||||
context->CSSetShader(csBokehFirst, NULL, 0);
|
||||
context->Dispatch(80, 45, 1);
|
||||
|
||||
//context->GenerateMips(tex1.SRV);
|
||||
//context->GenerateMips(tex2.SRV);
|
||||
|
||||
ID3D11UnorderedAccessView* bokehSecondUAV[] = {tex3.UAV, NULL};
|
||||
ID3D11ShaderResourceView* bokehSecondSRV[] = {tex1.SRV, tex2.SRV };
|
||||
context->CSSetUnorderedAccessViews(0, 2, bokehSecondUAV, NULL);
|
||||
context->CSSetShaderResources(0, 2, bokehSecondSRV);
|
||||
context->CSSetShader(csBokehSecond, NULL, 0);
|
||||
context->Dispatch(80, 45, 1);
|
||||
}
|
||||
|
||||
context->GenerateMips(tex3.SRV);
|
||||
|
||||
context->CSSetUnorderedAccessViews(0, 1, &backBufferUAV, NULL);
|
||||
context->CSSetShaderResources(0, 1, &tex3.SRV);
|
||||
context->CSSetShader(csRadialCircumferentialBlur, NULL, 0);
|
||||
context->Dispatch(80, 45, 1);
|
||||
|
||||
ID3D11UnorderedAccessView* nullUAV[] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
|
||||
ID3D11ShaderResourceView* nullSRV[] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
|
||||
context->CSSetUnorderedAccessViews(0, 8, nullUAV, NULL);
|
||||
context->CSSetShaderResources(0, 8, nullSRV);
|
||||
|
||||
#ifndef FULLSCREEN
|
||||
PeekMessageA(0, 0, 0, 0, PM_NOREMOVE);
|
||||
#endif
|
||||
swapChain->Present(1, 0);
|
||||
} while (!GetAsyncKeyState(VK_ESCAPE));
|
||||
|
||||
ExitProcess(0);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
763
hgplus/las/framework-dx11/test.hlsl
Normal file
763
hgplus/las/framework-dx11/test.hlsl
Normal file
@@ -0,0 +1,763 @@
|
||||
#define PI 3.14159265
|
||||
#define T [numthreads(16, 16, 1)]
|
||||
|
||||
RWTexture2D<float4> out0:register(u0);
|
||||
RWTexture2D<float4> out1:register(u1);
|
||||
|
||||
Texture2D tex0: register(t0);
|
||||
Texture2D tex1: register(t1);
|
||||
Texture2D tex2: register(t2);
|
||||
Texture2D tex3: register(t3);
|
||||
|
||||
SamplerState sampler0 : register(s0);
|
||||
|
||||
static uint rndSeed = 0;
|
||||
|
||||
uint hash(uint x) {
|
||||
return x += x << 10, x ^= x >> 6, x += x << 3, x ^= x >> 11, x += x << 15, x;
|
||||
}
|
||||
|
||||
float rnd() {
|
||||
return asfloat((rndSeed = hash(rndSeed) & 0x007fffff) | 0x3f800000) - 1;
|
||||
}
|
||||
|
||||
float srnd() {
|
||||
return asfloat((rndSeed = hash(rndSeed) & 0x007fffff) | 0x40000000) - 3;
|
||||
}
|
||||
|
||||
float rnd(uint s) {
|
||||
return asfloat((s & 0x007fffff) | 0x3f800000) - 1;
|
||||
}
|
||||
|
||||
float srnd(uint s) {
|
||||
return asfloat((s & 0x007fffff) | 0x40000000) - 3;
|
||||
}
|
||||
|
||||
float expf(float x) {
|
||||
return asfloat(int(12102203 * x + 1064866805));
|
||||
}
|
||||
|
||||
float2 mod(float2 x, float y) {
|
||||
return x - y * floor(x / y);
|
||||
}
|
||||
|
||||
float pulse(float center, float width, float x) {
|
||||
float t = abs(x - center);
|
||||
if (t > width) return 0;
|
||||
t /= width;
|
||||
return 1 - t*t*(3 - 2 * t);
|
||||
}
|
||||
|
||||
float fhex(float2 p, float s) {
|
||||
return p = abs(p), max(p.x + p.y*0.57735, p.y*1.1547) - s;
|
||||
}
|
||||
|
||||
//---
|
||||
// Bokeh
|
||||
//---
|
||||
static const float bkRadius = 32;
|
||||
static const float bkFocus = 1.0;
|
||||
static const float bkAperature = 8;
|
||||
static const float bkBorderStrength = 0;
|
||||
|
||||
float bkCircleOfConfusion(float depth) {
|
||||
return clamp(bkAperature * abs(depth - bkFocus) / bkFocus, 1, bkRadius);
|
||||
}
|
||||
|
||||
T void csBokehPreprocess(int3 id:SV_DispatchThreadID) {
|
||||
float2 resolution;
|
||||
out0.GetDimensions(resolution.x, resolution.y);
|
||||
|
||||
float2 tc = (id.xy) / resolution;
|
||||
|
||||
// Compute and premultiply CoC
|
||||
float4 s = tex0.SampleLevel(sampler0, tc, 0);
|
||||
float coc = bkCircleOfConfusion(s.w);
|
||||
|
||||
// Alternative CoC computations
|
||||
//float coc = bkCircleOfConfusion(tex0.SampleLevel(sampler0, tc, 2).w);
|
||||
|
||||
//float4 depth = tex0.GatherAlpha(sampler0, tc);
|
||||
//float coc = (
|
||||
// bkCircleOfConfusion(depth.x) +
|
||||
// bkCircleOfConfusion(depth.y) +
|
||||
// bkCircleOfConfusion(depth.z) +
|
||||
// bkCircleOfConfusion(depth.w)
|
||||
// ) * 0.25;
|
||||
|
||||
out0[id.xy] = float4(s.xyz, 1) * coc;
|
||||
}
|
||||
|
||||
float4 bkSample(float2 tc, float2 d, Texture2D tex) {
|
||||
// Fetch reference CoC
|
||||
float referenceCoc = tex.SampleLevel(sampler0, tc, 0).w;
|
||||
|
||||
float sigma = 0;
|
||||
float4 a = 0;
|
||||
for (float i = 0.5; i < bkRadius; ++i) {
|
||||
// Fetch sample float4(RGB,1)*coc
|
||||
float4 s = tex.SampleLevel(sampler0, d * i + tc, 0);
|
||||
|
||||
// Compute and accumulate weighting factor
|
||||
float weight = saturate(referenceCoc - i) * (saturate(s.w - i) + bkBorderStrength * step(bkRadius,i+1));
|
||||
sigma += weight;
|
||||
|
||||
// Accumulate weighted contribution
|
||||
a += s * weight;
|
||||
}
|
||||
|
||||
return a / sigma;
|
||||
}
|
||||
|
||||
T void csBokehFirst(int3 id:SV_DispatchThreadID) {
|
||||
float2 resolution;
|
||||
out0.GetDimensions(resolution.x, resolution.y);
|
||||
|
||||
float2 tc = (id.xy + 0.5) / resolution;
|
||||
|
||||
float4 sA = bkSample(tc, float2( 0, 1) / resolution, tex0);
|
||||
float4 sB = bkSample(tc, float2(-.8660254, -.5) / resolution, tex0);
|
||||
|
||||
out0[id.xy] = sA;
|
||||
out1[id.xy] = (sA + sB) * 0.5;
|
||||
}
|
||||
|
||||
T void csBokehSecond(int3 id:SV_DispatchThreadID) {
|
||||
float2 resolution;
|
||||
out0.GetDimensions(resolution.x, resolution.y);
|
||||
|
||||
float2 tc = (id.xy + 0.5) / resolution;
|
||||
|
||||
float4 sA = bkSample(tc, float2(-.8660254, -.5) / resolution, tex0);
|
||||
float4 sB = bkSample(tc, float2(+.8660254, -.5) / resolution, tex1);
|
||||
|
||||
out0[id.xy] = (sA += sB * 2) / sA.w;
|
||||
}
|
||||
|
||||
T void csScatterBokeh(int3 id:SV_DispatchThreadID) {
|
||||
|
||||
}
|
||||
|
||||
//---
|
||||
// Radial and circumferential blur
|
||||
//---
|
||||
static const float rcfMipmapFactor = 1.5;
|
||||
static const float rcfStepFactor = 5;
|
||||
static const float rcfStrength = 100;
|
||||
static const float rcfCircumFerentialStrength = 1.0;
|
||||
static const float rcfRadius = 5;
|
||||
static const float2 rcfCenter = {0.5, 0.5};
|
||||
|
||||
float rcfRadialFalloff(float radius, float amount) {
|
||||
return radius * (1 + amount*radius*0.01);
|
||||
}
|
||||
|
||||
T void csRadialCircumferentialBlur(int3 id:SV_DispatchThreadID) {
|
||||
float2 resolution;
|
||||
out0.GetDimensions(resolution.x, resolution.y);
|
||||
|
||||
float2 tc = (id.xy + 0.5) / resolution;
|
||||
|
||||
// Direction from rcfCenter to the current tc, aspect ratio corrected
|
||||
float2 d = (tc - rcfCenter) * float2(resolution.x/resolution.y, 1);
|
||||
|
||||
// Compute convolution step size
|
||||
float delta = length(d);
|
||||
float distortedDelta = rcfRadialFalloff(delta, rcfStrength);
|
||||
float stepSize = abs(delta - distortedDelta) * rcfStepFactor;
|
||||
|
||||
float radius = rcfRadius;
|
||||
// Circumferential blur
|
||||
if (rcfCircumFerentialStrength > 0) {
|
||||
d = float2(d.y, -d.x);
|
||||
stepSize *= rcfCircumFerentialStrength;
|
||||
radius = floor(rcfRadius * rcfCircumFerentialStrength);
|
||||
}
|
||||
|
||||
// Early exit
|
||||
if (radius <= 0.5 || stepSize <= 1/resolution.x) {
|
||||
out0[id.xy] = tex0.SampleLevel(sampler0, tc, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
// Adjust direction
|
||||
d = normalize(d) * stepSize / resolution;
|
||||
|
||||
// Convolution
|
||||
float mipLevel = sqrt(stepSize) * rcfMipmapFactor;
|
||||
float sigma = radius/2;
|
||||
float twoSigmaSquared = 2 * sigma * sigma;
|
||||
float4 a = 0;
|
||||
for (float i = -radius; i <= radius; ++i) {
|
||||
float weight = exp(-i*i/twoSigmaSquared);
|
||||
a += tex0.SampleLevel(sampler0, i * d + tc, mipLevel) * weight;
|
||||
}
|
||||
|
||||
out0[id.xy] = a / sqrt(twoSigmaSquared * PI);
|
||||
}
|
||||
|
||||
//---
|
||||
// Small lens dirt
|
||||
//---
|
||||
|
||||
|
||||
//---
|
||||
// Lens dirt
|
||||
//---
|
||||
static const float ldMinRadius = 16;
|
||||
static const float ldMaxRadius = 32;
|
||||
static const float ldCellWidth = 128;
|
||||
static const float ldBorderWidthHalf = 1.5;
|
||||
static const float ldSeed = 2;
|
||||
static const float ldNumLayers = 4;
|
||||
|
||||
T void csLensDirt(int3 id:SV_DispatchThreadID) {
|
||||
float2 tc = id.xy + .5;
|
||||
|
||||
rndSeed = ldSeed;
|
||||
|
||||
float4 a = 0;
|
||||
for (int i = 0; i < ldNumLayers; ++i) {
|
||||
// Modulo repeat, find cell
|
||||
float2 p = mod(tc, ldCellWidth) - ldCellWidth / 2;
|
||||
float2 c = floor(tc / ldCellWidth);
|
||||
|
||||
// Backup seed
|
||||
uint seedBackup = rndSeed;
|
||||
|
||||
// Modifiy seed with cell coordinates
|
||||
rndSeed += c.x + c.y*ldCellWidth + i*ldCellWidth*ldCellWidth;
|
||||
|
||||
// Determine radius and jitter
|
||||
float r = lerp(ldMinRadius, ldMaxRadius, rnd());
|
||||
p += float2(srnd(), srnd()) * (ldCellWidth / 2 - r);
|
||||
|
||||
// Shapes
|
||||
// Hexagon
|
||||
//p = abs(p);
|
||||
//float d = max(p.y + p.x*0.57735, p.x*1.1547);
|
||||
|
||||
// Circle
|
||||
//float d = length(p);
|
||||
|
||||
// Pentagon
|
||||
float phi = 0.145;
|
||||
float2 n[] = {
|
||||
{ sin(0*PI/5 + phi), cos(0*PI/5 + phi) },
|
||||
{ sin(2*PI/5 + phi), cos(2*PI/5 + phi) },
|
||||
{ sin(4*PI/5 + phi), cos(4*PI/5 + phi) },
|
||||
{ sin(6*PI/5 + phi), cos(6*PI/5 + phi) },
|
||||
{ sin(8*PI/5 + phi), cos(8*PI/5 + phi) }
|
||||
};
|
||||
// Difference between circumcircle and incircle radii
|
||||
float delta = r - (1 + sqrt(5)) / 4 * r;
|
||||
float d = max(max(max(max(dot(p, n[0]), dot(p, n[1])), dot(p, n[2])), dot(p, n[3])), dot(p, n[4]));
|
||||
// Mix between sphere and pentagon
|
||||
d = lerp(length(p), d+ delta, 0.5);
|
||||
|
||||
// Random color
|
||||
a += (float4(rnd(), rnd(), rnd(), 1) + 0.5) * (smoothstep(r, r - ldBorderWidthHalf * 2, d) + smoothstep(ldBorderWidthHalf, 0, abs(d - r + ldBorderWidthHalf * 2)));
|
||||
//a += float4(c, 0, 1)*0.1;
|
||||
|
||||
// Restore seed
|
||||
rndSeed = seedBackup;
|
||||
|
||||
// Displace grid
|
||||
tc += ldCellWidth / ldNumLayers;
|
||||
}
|
||||
|
||||
out0[id.xy] = float4(a.xyz / ldNumLayers, 1);
|
||||
}
|
||||
|
||||
//---
|
||||
// Blur
|
||||
//---
|
||||
static const float bRadius = 160;
|
||||
static const float bSigma = bRadius / 3;
|
||||
static const float bTwoSigmaSquared = 2 * bSigma * bSigma;
|
||||
|
||||
void bBlur(int3 id, float2 direction) {
|
||||
float2 resolution;
|
||||
out0.GetDimensions(resolution.x, resolution.y);
|
||||
|
||||
float2 sourceResolution;
|
||||
tex0.GetDimensions(sourceResolution.x, sourceResolution.y);
|
||||
|
||||
float mipLevel = log2(sourceResolution.x / resolution.x);
|
||||
|
||||
float2 tc = (id.xy + 0.5) / resolution;
|
||||
float2 d = direction / resolution;
|
||||
|
||||
float4 a = 0;
|
||||
for (float i = -bRadius; i <= bRadius; ++i) {
|
||||
float weight = expf(-i*i/bTwoSigmaSquared);
|
||||
a += tex0.SampleLevel(sampler0, i * d + tc, mipLevel) * weight;
|
||||
}
|
||||
|
||||
out0[id.xy] = a / sqrt(bTwoSigmaSquared * PI);
|
||||
}
|
||||
|
||||
T void csBlurH(int3 id:SV_DispatchThreadID) { bBlur(id, float2(1,0)); }
|
||||
T void csBlurV(int3 id:SV_DispatchThreadID) { bBlur(id, float2(0,1)); }
|
||||
|
||||
//---
|
||||
// Streaks
|
||||
//---
|
||||
static const float stRadius = 160;
|
||||
|
||||
T void csStreaks(int3 id:SV_DispatchThreadID) {
|
||||
float2 resolution;
|
||||
out0.GetDimensions(resolution.x, resolution.y);
|
||||
|
||||
float2 sourceResolution;
|
||||
tex0.GetDimensions(sourceResolution.x, sourceResolution.y);
|
||||
|
||||
float mipLevel = log2(sourceResolution.x / resolution.x);
|
||||
|
||||
float2 tc = (id.xy + 0.5) / resolution;
|
||||
float2 d = float2(1, 0) / resolution;
|
||||
|
||||
// Convolution with parabolic tent filter
|
||||
float4 a = 0;
|
||||
for (float i = -stRadius+1; i < stRadius; ++i) {
|
||||
float weight = (stRadius - abs(i)) * (stRadius - abs(i));
|
||||
a += tex0.SampleLevel(sampler0, i * d + tc, mipLevel) * weight;
|
||||
}
|
||||
|
||||
out0[id.xy] = a * 1.5 / (stRadius * stRadius * stRadius);
|
||||
}
|
||||
|
||||
//---
|
||||
// Merge
|
||||
//---
|
||||
T void csMerge(int3 id:SV_DispatchThreadID) {
|
||||
|
||||
out0[id.xy] = 1;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
#define ST_NUMTHREADS_X 16
|
||||
#define ST_NUMTHREADS_Y 16
|
||||
|
||||
#define ST_STRIDE (ST_NUMTHREADS_X + stRadius * 2)
|
||||
groupshared float4 sData[ST_STRIDE * ST_NUMTHREADS_Y];
|
||||
#define ST_ACCESS(X,Y) sData[clamp(X+stRadius, 0, ST_STRIDE-1) + ST_STRIDE * Y]
|
||||
[numthreads(ST_NUMTHREADS_X, ST_NUMTHREADS_Y, 1)]
|
||||
void csStreaksTest(int3 id:SV_DispatchThreadID, int3 gid : SV_GroupThreadID) {
|
||||
float2 resolution;
|
||||
|
||||
tex0.GetDimensions(resolution.x, resolution.y);
|
||||
float2 d = normalize(float2(1, 0)) / resolution;
|
||||
|
||||
float2 tc = (id.xy + 0.5) / resolution;
|
||||
ST_ACCESS(gid.x, gid.y) = tex0.SampleLevel(sampler0, tc, 0);
|
||||
|
||||
int N = (stRadius+ST_NUMTHREADS_X-1) / ST_NUMTHREADS_X;
|
||||
int M = stRadius / N;
|
||||
if (gid.x < stRadius)
|
||||
for (int i = 1 ; i <= N; ++i) {
|
||||
ST_ACCESS(gid.x + M*i, gid.y) = tex0.SampleLevel(sampler0, tc + d * M*i, 0);
|
||||
ST_ACCESS(gid.x - M*i, gid.y) = tex0.SampleLevel(sampler0, tc - d * M*i, 0);
|
||||
}
|
||||
|
||||
GroupMemoryBarrier();
|
||||
|
||||
float4 color = 0;
|
||||
int j = ST_STRIDE * gid.y;
|
||||
////int k = gid.x;
|
||||
//for (float i = 0; i < stRadius; ++i) {
|
||||
// int ii = (i+k) % ST_STRIDE;
|
||||
// float weight = (stRadius - abs(ii)) * (stRadius - abs(ii));
|
||||
// //color += ST_ACCESS(gid.x+i, gid.y) * weight;
|
||||
// color += sData[j++] * weight;
|
||||
//}
|
||||
|
||||
for (float i = -stRadius+1; i < stRadius; ++i) {
|
||||
float weight = (stRadius - abs(i)) * (stRadius - abs(i));
|
||||
//color += ST_ACCESS(gid.x+i, gid.y) * weight;
|
||||
color += sData[j++] * weight;
|
||||
}
|
||||
|
||||
out0[id.xy] = color * 1.5 / (stRadius * stRadius * stRadius);
|
||||
}
|
||||
|
||||
*/
|
||||
//---
|
||||
// Test 1
|
||||
//---
|
||||
static float3 d, p, n;
|
||||
static float h, i, j, k;
|
||||
static float d0, d1, d2, d3, dOut;
|
||||
|
||||
|
||||
float ff(float3 p){
|
||||
d0 = 30 - length(p);
|
||||
d1 = length(p - float3(0, 1, 0)) - 0.02;
|
||||
d2 = p.y;
|
||||
float3 q = p;
|
||||
q.x = abs(q.x) - 2;
|
||||
q.y -= 1;
|
||||
q.y = abs(q.y) - 0.5;
|
||||
//
|
||||
q.z = frac(q.z);
|
||||
d3 = length(q) - 0.15;
|
||||
return dOut = min(min(d0, d1), min(d2, d3));
|
||||
}
|
||||
|
||||
T void csRaytrace(int3 id:SV_DispatchThreadID) {
|
||||
//out0[id.xy] = float4(id.y % 16, id.x % 16, 0, 1)*0.1;
|
||||
p = float3(0, .5, 4);
|
||||
float3 q = p;
|
||||
|
||||
d = mul(float3x3(.002, 0, -1.279, 0, -.002, 0.719, 0, 0, 1), float3(id.xy, 1));
|
||||
d = normalize(float3(d.xy, -1));
|
||||
|
||||
for (h = .001, i = k = 1; k + 2 > i + h; i += h)
|
||||
k = ff(p), p += d*k;
|
||||
|
||||
float4 color = 0.25;
|
||||
if (dOut == d0)
|
||||
color = float4(0, 0, 0, 1); // background
|
||||
if (dOut == d1)
|
||||
color = float4(1, 1, 0, 1)*100; // sphere
|
||||
if (dOut == d2)
|
||||
color = float4(0.5, 0, 0, 1); // ground
|
||||
if (dOut == d3)
|
||||
color = float4(1, 1, 0, 1); // sphere
|
||||
|
||||
|
||||
n = normalize(float3(ff(float3(h, 0, 0) + p), ff(float3(0, h, 0) + p), ff(float3(0, 0, h) + p)) - ff(p));
|
||||
|
||||
for (h = .1, i = j = k = 1; i < 6; i += 1)
|
||||
j -= (i*h - ff(p + n*i*h)) / (k *= 2);
|
||||
|
||||
float depth = dot(float3(0, 0, -1), d*length(p - q));
|
||||
//float coc = bkCircleOfConfusion(depth);
|
||||
float4 c = float4(color.xyz * (j*0.5 + (n*0.5 + 0.5)*0.5), depth);
|
||||
//c.w = 1;
|
||||
out0[id.xy] = c;
|
||||
}
|
||||
//---- RM-
|
||||
|
||||
|
||||
T void cs2(int3 id:SV_DispatchThreadID) {
|
||||
out0[id.xy] = float4(1, id.xy / float2(1280, 720), 1);
|
||||
if (abs(id.y-359.5) <= 4 && abs(id.x-639.5) <= 100)
|
||||
out0[id.xy] = 1;
|
||||
}
|
||||
|
||||
|
||||
T void cs__(int3 id:SV_DispatchThreadID) {
|
||||
out0[id.xy] = float4((id.xy + 0.5) / float2(1280, 720), 0, 1);
|
||||
|
||||
}
|
||||
|
||||
//---
|
||||
// Test 2
|
||||
//---
|
||||
static const float t = 100.0;
|
||||
|
||||
#define VP float3(.947556,4.117568,-1.34871)
|
||||
#define LP (VP+float3(0.16591,-.983647,-0.06044))
|
||||
#define UP float3(0.944249,0.179789,-.275808)
|
||||
|
||||
//#define VP vViewPosition.xyz
|
||||
//uniform float4 vViewPosition;
|
||||
//#define LP (VP+vViewDirection.xyz)
|
||||
//uniform float4 vViewDirection;
|
||||
//#define UP (vViewUp.xyz)
|
||||
//uniform float4 vViewUp;
|
||||
|
||||
static const float2 r = float2(1280, 720);
|
||||
static const float3 viewPosition = VP;
|
||||
static const float3 viewDirection = normalize(LP - VP);
|
||||
static const float3 viewUp = UP;
|
||||
static const float fovOffset = 0.4;
|
||||
static const float lensDistortion0 = -0.125;
|
||||
static const float lensDistortion1 = 0;
|
||||
static const float lensDistortion2 = +0.125;
|
||||
static const float lensDistortion3 = 0;
|
||||
static const float cam_shake = 0;
|
||||
|
||||
#define uTime t
|
||||
|
||||
float pn(float3 p) {
|
||||
p *= 1.5;
|
||||
float3 i = floor(p);
|
||||
float4 a = dot(i, float3(1, 57, 21)) + float4(0, 57, 21, 78);
|
||||
float3 f = cos((p - i)*acos(-1.))*(-.5) + .5;
|
||||
a = lerp(sin(cos(a)*a), sin(cos(1 + a)*(1 + a)), f.x);
|
||||
a.xy = lerp(a.xz, a.yw, f.y);
|
||||
return lerp(a.x, a.y, f.z);
|
||||
}
|
||||
|
||||
float fpn(float3 p) {
|
||||
float r;
|
||||
p.xz = cos(1.) * p.xz + float2(-sin(1.), sin(1.)) * p.zx;
|
||||
r = pn(p*.06125)*.5;
|
||||
p.xy = cos(1.) * p.xy + float2(-sin(1.), sin(1.)) * p.yx;
|
||||
r += pn(p*.125)*.25;
|
||||
p.zy = cos(1.) * p.zy + float2(-sin(1.), sin(1.)) * p.yz;
|
||||
r += pn(p*.25)*.125;
|
||||
return r;
|
||||
}
|
||||
|
||||
// Globals
|
||||
float3 modXZ(float3 p, float m) {
|
||||
return p.xz = mod(p.xz + m / 2, m) - m / 2, p;
|
||||
}
|
||||
|
||||
float max3(float3 v) {
|
||||
return max(max(v.x, v.y), v.z);
|
||||
}
|
||||
|
||||
float fbox(float3 p, float3 b) {
|
||||
float3 d = abs(p) - b;
|
||||
return length(max(d, 0)) + max3(min(d, 0));
|
||||
}
|
||||
|
||||
float fsphere(float3 p, float r) {
|
||||
return length(p) - r;
|
||||
}
|
||||
|
||||
float fblob(float3 p) {
|
||||
p = abs(p);
|
||||
if (p.x <= max(p.z, p.y)) p = p.yzx;
|
||||
if (p.x <= max(p.z, p.y)) p = p.yzx;
|
||||
|
||||
float b = max(max(max(
|
||||
dot(p, float3(.577, .577, .577)),
|
||||
dot(p.xz, float2(.934, .357))),
|
||||
dot(p.yx, float2(.526, .851))),
|
||||
dot(p.xz, float2(.526, .851))
|
||||
), l = length(p);
|
||||
|
||||
return l - 2.5 - 0.3*(2.5 / 2)* cos(min(sqrt(1.01 - b / l)*(PI / 0.25), PI));
|
||||
}
|
||||
|
||||
float ftest(float3 p) {
|
||||
#define phi (.5*(1+sqrt(5)))
|
||||
float3 n0 = normalize(float3(-phi, phi - 1, 1));
|
||||
float3 n1 = normalize(float3(1, -phi, phi + 1));
|
||||
p = abs(p);
|
||||
p -= 2 * max(0, dot(p, n0))*n0;
|
||||
p -= 2 * max(0, dot(p, n1))*n1;
|
||||
p = abs(p);
|
||||
p -= 2 * max(0, dot(p, n0))*n0;
|
||||
p -= 2 * max(0, dot(p, n1))*n1;
|
||||
p = abs(p);
|
||||
return p.y - 1.5;
|
||||
}
|
||||
|
||||
float fhex(float3 p, float2 h) {
|
||||
float3 q = abs(p);
|
||||
return max(q.y - h.y, max(q.z*0.866025 + q.x*0.5, q.x) - h.x);
|
||||
}
|
||||
|
||||
float3x3 rotX(float a) {
|
||||
return float3x3 (1, 0, 0, 0, cos(a), -sin(a), 0, sin(a), cos(a));
|
||||
}
|
||||
|
||||
// Hammer anfang
|
||||
#define Ro(p, a) p=cos((a))*p+sin((a))*float2(p.y, -p.x)
|
||||
float combine_d2(float d1, float d2, float r) {
|
||||
float result;
|
||||
if ((d1 < r) && (d2 < r)) {
|
||||
result = (d1 - r + d2)*sqrt(0.5);
|
||||
} else {
|
||||
result = min(d1, d2);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
float combine_d(float d1, float d2, float r) {
|
||||
float result;
|
||||
if ((d1 < r) && (d2 < r)) {
|
||||
result = (d1 - r + d2)*sqrt(0.5);
|
||||
} else {
|
||||
result = min(d1, d2);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
float cylinder(float3 p, float r, float c) {
|
||||
float d = length(p.xz) - r;
|
||||
d = max(d, -p.y - c);
|
||||
d = max(d, p.y - c);
|
||||
return d;
|
||||
}
|
||||
|
||||
float hammer(float3 p) {
|
||||
//float h = box(p-float3(0,1,0),float3(2,10,3));
|
||||
//if (h > 1) return h;
|
||||
|
||||
float S = 0.5;
|
||||
|
||||
p.y -= 9 * S;
|
||||
float3 q = p*(1 - 1 / (0.1 + sqrt(length(p)))*0.3 / S); //bauchiger machen
|
||||
float d = fbox(q, S*float3(1, 1, 1.4)) - 0.02*S;
|
||||
|
||||
//return d;
|
||||
float2 pxy = abs(p.xy);
|
||||
Ro(pxy, -PI*0.5);
|
||||
d = max(d, pxy.x + .8);
|
||||
d = combine_d(d, fbox(q, S*float3(0.7, 0.7, 1.75)) - 0.02*S, S*0.3);
|
||||
d = combine_d2(d, cylinder(p + S*float3(0, 0.9, 0), 0.4*S, 1.6*S), S*0.1);
|
||||
d = combine_d2(d, cylinder(p + S*float3(0, 6, 0), 0.5*S, 7.3*S), S*0.1);
|
||||
d = combine_d2(d, cylinder(p + S*float3(0, 11.6, 0), 0.4*S, 1.7*S), S*0.1);
|
||||
return d;
|
||||
}
|
||||
//Hammer ende
|
||||
|
||||
static float s, s0, s1, s2, s3;
|
||||
float f(float3 p) {
|
||||
// GroundPlane
|
||||
s0 = min(p.y + 3, -length(p) + 100);
|
||||
s1 = s2 = s3 = 100000;
|
||||
|
||||
//s1 = fhex(p-float3(sin(acos(-1)*4./3),0.0,cos(acos(-1)*4./3)), float2(1.5, 0.3));
|
||||
//s2 = fhex(p-float3(sin(acos(-1)*2./3),0.7,cos(acos(-1)*2./3)), float2(1.5, 0.3));
|
||||
//s3 = fhex(p-float3(sin(acos(-1)*0./3),1.4,cos(acos(-1)*0/3)), float2(1.5, 0.3));
|
||||
|
||||
s2 = fblob(p);//fblob(p);
|
||||
p.yx = p.xy;
|
||||
p.z += 5;
|
||||
Ro(p.yz, .5);
|
||||
s3 = hammer(p);
|
||||
return s = min(min(s0, s1), min(s2, s3));
|
||||
}
|
||||
float3 skydome(float3 direction) {
|
||||
direction = normalize(direction);
|
||||
float3 col = 0.4 * float3(1, 0.8, 0.5)* max(0.0, +fpn(direction * 13))*3.5;
|
||||
col += 0.3 * float3(0.8, 0.9, 1.0)* max(0.0, +fpn(direction * 8 + 100))*2.7;
|
||||
col += float3(0.5, 0.6, 1.0)* max(0.0, fpn(direction * 20 + 20) - 0.4) * 10;
|
||||
float3 p = direction;
|
||||
|
||||
//col += float3(1.0,0.6,0.15)* pow(max(0.0,dot(normalize(p), normalize(float3(0.0,1,-8)))),600.0)*400; //sun
|
||||
col = pow(col, float3(2, 2, 2));
|
||||
return col*1.8;
|
||||
}
|
||||
|
||||
|
||||
float3 G(float3 p) {
|
||||
return normalize(float3(f(float3(.001, 0, 0) + p), f(float3(0, .001, 0) + p), f(float3(0, 0, .001) + p)) - f(p));
|
||||
}
|
||||
|
||||
float2 I(float3 p, float3 d, float k, float e, float m) {
|
||||
float3 q = p;
|
||||
float i = 0, j = 0, l = sign(f(p));
|
||||
while (i < 1 && abs(s) >= j*e&&j < m)
|
||||
f(p), j += abs(s), p += l*d*s, i += k;
|
||||
return float2(2 * l*max(abs(s), 0.025)*step(i, 1)*step(j, m), distance(q, p));
|
||||
}
|
||||
|
||||
float A(float3 p, float3 d) {
|
||||
float h = .5, i = 1, j = 1, k = 1;
|
||||
while (i < 8)
|
||||
j -= (i*h - f(p + d*i*abs(h))) / (k *= 2), i++;
|
||||
return j;
|
||||
}
|
||||
|
||||
#define R0 0.18
|
||||
float fresnel(float3 d, float3 n) {
|
||||
float x = 1. - abs(dot(n, d));
|
||||
return R0 + (1. - R0) * x*x*x*x;
|
||||
}
|
||||
|
||||
float4 K() {
|
||||
return
|
||||
//(s==s3?float4(1.0,0.8,0.3,1):
|
||||
(s == s3 ? float4(1.0, 0.8, 0.3, 1) :
|
||||
(s == s2 ? float4(0.8, 0.3, 0.1, 1)*1.2 :
|
||||
(s == s1 ? float4(0.3, 0.6, 0.5, 1) :
|
||||
(s == s0 ? float4(1, 1, 1, 1) :
|
||||
(s == 10 ? float4(0, 1, 1, 1) :
|
||||
float4(1, 1, 1, 1))))));
|
||||
}
|
||||
|
||||
float4 K(float3 p, float3 d, float3 n) {
|
||||
float3 l = normalize(float3(2, 20, 17) +
|
||||
10 * float3(cos(t * 2), 0, sin(t * 2)) - p);
|
||||
float3 l2 = normalize(float3(-10, 20, 7));
|
||||
float3 l3 = normalize(float3(1, 1, 1.3));
|
||||
|
||||
float4 c = K();
|
||||
if (s == s0) {
|
||||
c *= (A(p, n)*.5 + .5);
|
||||
c *= 1.3 / pow(log(length(p)), 1.3);
|
||||
c += ((0.0 + 0.5*fpn(p*float3(2, 2, 2)))*1.125) + .02*fpn(p.zxy * 1000);
|
||||
if (c.x > 0.5) c.x = 1 - c.x;
|
||||
if (c.y > 0.5) c.y = 1 - c.y;
|
||||
if (c.z > 0.5) c.z = 1 - c.z;
|
||||
//c = float4(1) - c;
|
||||
} else if (s == s1 || s == s2 || s == s3) {
|
||||
|
||||
c = c*.5 + .5;
|
||||
c *= max(max(
|
||||
pow(max(abs(dot(n, normalize(l - p))), 0), 248.) * 10.0,
|
||||
pow(max(abs(dot(n, normalize(l2 - p))), 0), 248.) * 10.0),
|
||||
pow(max(abs(dot(n, normalize(l3 - p))), 0), 648.) * 200.0);
|
||||
c.xyz += skydome(reflect(d, n)) * 0.5;
|
||||
} else {
|
||||
c = c*dot(n, l);
|
||||
}
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
float4 B(float3 p, float3 d, float3 n, float2 h) {
|
||||
float4 a = float4(1, 1, 1, 1), c = float4(0, 0, 0, 0);
|
||||
for (int i = 0; i < 8 && (f(p) == s1 || s == s2 || s == s3); ++i) {
|
||||
float3 x = d;
|
||||
a *= 1 - fresnel(d, n);
|
||||
d = refract(d, n * sign(h.x), lerp(1.05, 1 / 1.05, sign(h.x) * .5 + .5));
|
||||
if (dot(d, d) == 0)d = reflect(x, n), h.x *= -1.;
|
||||
p -= n * h.x, h = I(p, d, 1 / 64.0, 0.005, 200), p += d*h.y;
|
||||
if (h.x == 0) {
|
||||
|
||||
break;
|
||||
}
|
||||
float J = 1.0;
|
||||
if (s == s3)
|
||||
J = 1.0;
|
||||
a *= lerp(exp(-h.y * J * 3 * (1 - K())), float4(1, 1, 1, 1), sign(h.x) * .5 + .5);
|
||||
n = G(p), c += K(p, d, n) * a;
|
||||
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
float4 R(float3 p, float3 d, float3 n, float2 h) {
|
||||
float4 a = float4(1, 1, 1, 1), c = float4(0, 0, 0, 0);
|
||||
for (int i = 0; i < 6 && (f(p) == s1 || s == s2 || s == s3); ++i) {
|
||||
a *= fresnel(d, n);
|
||||
d = reflect(d, n);
|
||||
p += n * h.x, h = I(p, d, 1 / 64.0, 0.01, 200), p += d*h.y;
|
||||
if (h.x == 0.0) break;
|
||||
n = G(p), c += K(p, d, n) * a;
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
T void csTestScene(int3 id:SV_DispatchThreadID) {
|
||||
float3 up = viewUp;
|
||||
float3 right = -cross(viewDirection, viewUp);
|
||||
float3 p = viewPosition;
|
||||
float3 d = normalize(float3((id.xy + 0.5 - float2(0.5*r)) / r.y, -1.0 + fovOffset)); //fov is fixed
|
||||
float r = length(d.xy);
|
||||
d.xy = normalize(d.xy)*(r + r*r*lensDistortion0 + pow(r, 4)*lensDistortion1 * 2 + pow(r, 6)*lensDistortion2 * 8 + pow(r, 8)*lensDistortion3 * 16);
|
||||
d.xy *= -1;
|
||||
d = mul(transpose(float3x3(right, viewUp, -viewDirection)), d);
|
||||
d = normalize(d);
|
||||
|
||||
float2 h = I(p, d, 1 / 128., 0.001, 200);
|
||||
//if(h.x==0){o0=float4(.3,0.4,.8,1);return;}
|
||||
p += d*h.y;
|
||||
float3 n = G(p);
|
||||
float4 c = K(p, d, n);
|
||||
c += B(p, d, n, h);
|
||||
c += R(p, d, n, h);
|
||||
float depth = dot(viewDirection, d*h.y);
|
||||
float coc = bkCircleOfConfusion(depth);
|
||||
out0[id.xy] = float4(c.xyz, h.y);
|
||||
}
|
||||
Reference in New Issue
Block a user