More spirv compile shit
This commit is contained in:
2
shaders/compile.bat
Normal file
2
shaders/compile.bat
Normal file
@@ -0,0 +1,2 @@
|
||||
for %%i in (*.frag) do glslangValidator -V %%i -o %%i.spv
|
||||
for %%i in (*.vert) do glslangValidator -V %%i -o %%i.spv
|
||||
@@ -1,4 +1,33 @@
|
||||
glslangValidator -V line.frag -o line_frag.spv
|
||||
glslangValidator -V line.vert -o line_vert.spv
|
||||
glslangValidator -V triangle.frag -o triangle_frag.spv
|
||||
glslangValidator -V triangle.vert -o triangle_vert.spv
|
||||
$compileHashFile = "compilehashes.xml"
|
||||
|
||||
if (Get-ChildItem -File $compileHashFile -ErrorAction SilentlyContinue) {
|
||||
$hashes = Import-Clixml $compileHashFile
|
||||
} else {
|
||||
$hashes = @{}
|
||||
}
|
||||
|
||||
function CompileShader($fileName) {
|
||||
$spvFileName = "$fileName.spv"
|
||||
$newHash = Get-FileHash -Path $fileName -Algorithm SHA1
|
||||
|
||||
$spvExists = $false
|
||||
if (Get-ChildItem -File $spvFileName -ErrorAction SilentlyContinue) {
|
||||
$spvExists = $true
|
||||
}
|
||||
|
||||
if ($spvExists -and $hashes.ContainsKey($fileName) -and $hashes[$fileName] -eq $newHash.Hash) {
|
||||
Write-Output "Skipping $fileName"
|
||||
} else {
|
||||
glslangValidator -V $fileName -o $spvFileName
|
||||
$hashes.$fileName = $newHash.Hash
|
||||
}
|
||||
}
|
||||
|
||||
Get-ChildItem -Filter *.vert | ForEach-Object {
|
||||
CompileShader $_.Name
|
||||
}
|
||||
Get-ChildItem -Filter *.frag | ForEach-Object {
|
||||
CompileShader $_.Name
|
||||
}
|
||||
|
||||
Export-Clixml -Path $compileHashFile -InputObject $hashes
|
||||
|
||||
@@ -40,5 +40,4 @@ void main() {
|
||||
vec3 specular_color = specular_value * specular_strength * light_color;
|
||||
|
||||
out_color = vec4(ambient_color + diffuse_color + specular_color, 1.0) * texture(diffuse_tex, tex_coords);
|
||||
// out_color = vec4(1, 0, 0, 1);
|
||||
}
|
||||
Reference in New Issue
Block a user