This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Function Creates an input layout from the vertex shader, after compilation. | |
//Input layout can be reused with any vertex shaders that use the same input layout. | |
HRESULT CreateInputLayoutDescFromVertexShaderSignature( ID3DBlob* pShaderBlob, ID3D11Device* pD3DDevice, ID3D11InputLayout** pInputLayout, int* inputLayoutByteLength ) | |
{ | |
// Reflect shader info | |
ID3D11ShaderReflection* pVertexShaderReflection = nullptr; | |
HRESULT hr = S_OK; | |
if ( FAILED( D3DReflect( pShaderBlob->GetBufferPointer(), pShaderBlob->GetBufferSize(), IID_ID3D11ShaderReflection, (void**) &pVertexShaderReflection ) ) ) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
// If necessary, use this to free raw pointers. | |
// Preferably, use Microsoft::WRL::ComPtr from client.h (http://msdn.microsoft.com/en-us/library/br244983.aspx) | |
#ifndef SAFE_RELEASE | |
#define SAFE_RELEASE(x) \ | |
if(x != NULL) \ | |
{ \ | |
x->Release(); \ | |
x = NULL; \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//PostBuild Event | |
// Copies .dll, .pdb, and .exe files from a directory named "dll" to output folder. | |
// Often, "dll" will be "lib", depending on where you put your .dll files. | |
// /F Display full source and destination file names while copying. | |
// /Y Suppress prompt to confirm overwriting a file. | |
// /D Copy only files whosesource date/time is newer than the destination time. | |
// $(SolutionDir) - Visual Studio Macro; the directory the project .sln file is located | |
// $(TargetDir) - Visual Studio Macro; the directory that the built executable is written to | |
xcopy "$(SolutionDir)dll\*.dll" "$(TargetDir)" /F /Y /D |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ##### ComputeShader.hlsl ##### | |
Texture2D TextureInput : register(t0); // Input texture to read from | |
RWTexture2D<float4> TextureOutput : register(u0); // Temp output | |
void main( uint3 DTid : SV_DispatchThreadID, uint3 groupID: SV_GroupID, uint3 groupThreadID: SV_GroupThreadID ) | |
{ | |
float4 vColor = TextureInput[int2(groupThreadID.x, groupID.y)]; | |
// do stuff to vColor | |
// Store result | |
TextureOutput[int2(groupThreadID.x,groupID.y)]=vColor; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create_matrix(len_a, len_b): | |
matrix = [0] * (len_a+1) | |
for i in range(len_a+1): | |
matrix[i] = [0] * (len_b+1) | |
return matrix | |
def get_sequence_indices(matrix): | |
len_row = len(matrix) | |
len_col = len(matrix[0]) |