: 명령 fxc.exe test.hlsl /T ps_5_0
와bool의 셰이더 본질적인 asfloat가 사라 졌습니까? 이 픽셀 셰이더 컴파일
float4 main() : SV_TARGET
{
bool4 b = bool4(true, false, true, false);
return asfloat(b);
}
실패 :
"C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Utilities\bin\x64\fxc.exe" /T ps_5_0 test.hlsl
Microsoft (R) Direct3D Shader Compiler 9.29.952.3111
Copyright (C) Microsoft Corporation 2002-2009. All rights reserved.
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//
// fxc /T ps_5_0 a.hlsl
//
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------ ------
// no Input
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------ ------
// SV_TARGET 0 xyzw 0 TARGET float xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_output o0.xyzw
mov o0.xyzw, l(1.000000,0,1.000000,0)
ret
// Approximately 2 instruction slots used
MSDN page on asfloat은하지 않습니다 :
Microsoft (R) Direct3D Shader Compiler 6.3.9600.16384 (using C:\Program Files (x86)\Windows Kits\8.1\bin\x64\D3DCOMPILER_47.dll)
Copyright (C) 2013 Microsoft. All rights reserved.
test.hlsl(13,12-21): error X3013: 'asfloat': no matching 1 parameter intrinsic function
test.hlsl(13,12-21): error X3013: Possible intrinsic functions are:
test.hlsl(13,12-21): error X3013: asfloat(float|half|int|uint)
compilation failed; no code produced
그것은 비록 쉐이더 컴파일러의 이전 버전과 함께 작동 이 내용이 변경되어 bool
과부하가 표시됩니다.
이것은 버그입니까? 내가 뭔가 잘못하고 있는거야? 이 내장재가 의도적으로 제거 되었습니까? 대신 무엇을 사용해야합니까? (실제로는 asfloat(all(...))
과 함께 사용했습니다.)
VS 2013 업데이트 5 및 VS 2015는 Windows 8.1 SDK Spring 2015 업데이트와 함께 제공되므로 최신 컴파일러가 필요합니다. ''asfloat''은''bool''에 대해서는 의미가 없습니다. 그래서 처음에는 그것을 받아 들일 수있는 버그라고 생각합니다. 또한 Windows 10 SDK 버전으로 빌드하는 데 실패합니다. –
@ChuckWalbourn 예, 전 이것은 최신 컴파일러에 관한 것입니다. 왜 그것이 말이되지 않습니까? 대신 무엇을 사용해야합니까? – Peter
bool은 논리 참/거짓 값이고 asfloat는 숫자를 float로 변환합니다. 정확히 무엇을하려고합니까? –