1
0
mirror of https://github.com/microsoft/DirectXTex synced 2024-11-24 13:20:13 +00:00

Updated shader build script

This commit is contained in:
Chuck Walbourn 2017-11-17 17:09:40 -08:00
parent 534863cab1
commit d749841658
2 changed files with 11 additions and 7 deletions

View File

@ -1188,6 +1188,8 @@ void EncodeBlockCS(uint GI : SV_GroupIndex, uint3 groupID : SV_GroupID)
uint bits2 = candidateSectionBit2[partition - 64];
uint2x4 ep;
ep[0] = MAX_UINT;
ep[1] = MIN_UINT;
uint2x4 ep_quantized;
[unroll]
for (int ii = 2; ii >= 0; -- ii)
@ -1572,7 +1574,7 @@ uint4 unquantize( uint4 color, uint uPrec )
uint2x4 compress_endpoints0( inout uint2x4 endPoint, uint2 P )
{
uint2x4 quantized;
for ( uint j = 0; j < 2; j ++ )
[unroll] for ( uint j = 0; j < 2; j ++ )
{
quantized[j].rgb = quantize(endPoint[j].rgbb, 5).rgb & 0xFFFFFFFE;
quantized[j].rgb |= P[j];
@ -1588,7 +1590,7 @@ uint2x4 compress_endpoints0( inout uint2x4 endPoint, uint2 P )
uint2x4 compress_endpoints1( inout uint2x4 endPoint, uint2 P )
{
uint2x4 quantized;
for ( uint j = 0; j < 2; j ++ )
[unroll] for ( uint j = 0; j < 2; j ++ )
{
quantized[j].rgb = quantize(endPoint[j].rgbb, 7).rgb & 0xFFFFFFFE;
quantized[j].rgb |= P[j];
@ -1604,7 +1606,7 @@ uint2x4 compress_endpoints1( inout uint2x4 endPoint, uint2 P )
uint2x4 compress_endpoints2( inout uint2x4 endPoint )
{
uint2x4 quantized;
for ( uint j = 0; j < 2; j ++ )
[unroll] for ( uint j = 0; j < 2; j ++ )
{
quantized[j].rgb = quantize(endPoint[j].rgbb, 5).rgb;
quantized[j].a = 0xFF;
@ -1633,7 +1635,7 @@ uint2x4 compress_endpoints3( inout uint2x4 endPoint, uint2 P )
uint2x4 compress_endpoints4( inout uint2x4 endPoint )
{
uint2x4 quantized;
for ( uint j = 0; j < 2; j ++ )
[unroll] for ( uint j = 0; j < 2; j ++ )
{
quantized[j].rgb = quantize(endPoint[j].rgbb, 5).rgb;
quantized[j].a = quantize(endPoint[j].a, 6).r;
@ -1649,7 +1651,7 @@ uint2x4 compress_endpoints4( inout uint2x4 endPoint )
uint2x4 compress_endpoints5( inout uint2x4 endPoint )
{
uint2x4 quantized;
for ( uint j = 0; j < 2; j ++ )
[unroll] for ( uint j = 0; j < 2; j ++ )
{
quantized[j].rgb = quantize(endPoint[j].rgbb, 7).rgb;
quantized[j].a = endPoint[j].a;
@ -1676,7 +1678,7 @@ uint2x4 compress_endpoints6( inout uint2x4 endPoint, uint2 P )
uint2x4 compress_endpoints7( inout uint2x4 endPoint, uint2 P )
{
uint2x4 quantized;
for ( uint j = 0; j < 2; j ++ )
[unroll] for ( uint j = 0; j < 2; j ++ )
{
quantized[j] = quantize(endPoint[j], 6) & 0xFFFFFFFE;
quantized[j] |= P[j];

View File

@ -9,6 +9,8 @@ rem Copyright (c) Microsoft Corporation. All rights reserved.
setlocal
set error=0
set FXCOPTS=/nologo /WX /Ges /Zi /Zpc /Qstrip_reflect /Qstrip_debug
set PCFXC="%WindowsSdkBinPath%%WindowsSDKVersion%\x86\fxc.exe"
if exist %PCFXC% goto continue
set PCFXC="%WindowsSdkDir%bin\%WindowsSDKVersion%\x86\fxc.exe"
@ -40,7 +42,7 @@ endlocal
exit /b
:CompileShader
set fxc=%PCFXC% /nologo %1.hlsl /Tcs_4_0 /Zi /Zpc /Qstrip_reflect /Qstrip_debug /E%2 /FhCompiled\%1_%2.inc /FdCompiled\%1_%2.pdb /Vn%1_%2
set fxc=%PCFXC% %1.hlsl %FXCOPTS% /Tcs_4_0 /E%2 /FhCompiled\%1_%2.inc /FdCompiled\%1_%2.pdb /Vn%1_%2
echo.
echo %fxc%
%fxc% || set error=1