This commit is contained in:
Branimir Karadžić 2016-03-22 21:52:11 -07:00
parent 8e8d8b3816
commit 1f2d56278c
4 changed files with 6 additions and 3 deletions

View File

@ -42,13 +42,13 @@ namespace bgfx
uint32_t magic;
bx::peek(_reader, magic);
if (magic == 0x07230203)
if (magic == SPV_CHUNK_HEADER)
{
SpirV spirv;
read(_reader, spirv, _err);
parse(spirv.shader, printAsm, _writer, _err);
}
else if (magic == BX_MAKEFOURCC('D', 'X', 'B', 'C') )
else if (magic == DXBC_CHUNK_HEADER)
{
DxbcContext dxbc;
read(_reader, dxbc, _err);

View File

@ -1735,7 +1735,6 @@ namespace bgfx
return size;
}
#define DXBC_CHUNK_HEADER BX_MAKEFOURCC('D', 'X', 'B', 'C')
#define DXBC_CHUNK_SHADER BX_MAKEFOURCC('S', 'H', 'D', 'R')
#define DXBC_CHUNK_SHADER_EX BX_MAKEFOURCC('S', 'H', 'E', 'X')

View File

@ -8,6 +8,8 @@
#include <bx/readerwriter.h>
#define DXBC_CHUNK_HEADER BX_MAKEFOURCC('D', 'X', 'B', 'C')
namespace bgfx
{
struct DxbcOpcode

View File

@ -11,6 +11,8 @@
BX_ERROR_RESULT(BGFX_SHADER_SPIRV_INVALID_HEADER, BX_MAKEFOURCC('S', 'H', 0, 1) );
BX_ERROR_RESULT(BGFX_SHADER_SPIRV_INVALID_INSTRUCTION, BX_MAKEFOURCC('S', 'H', 0, 2) );
#define SPV_CHUNK_HEADER BX_MAKEFOURCC(0x03, 0x02, 0x23, 0x07)
namespace bgfx
{
// Reference: https://www.khronos.org/registry/spir-v/specs/1.0/SPIRV.html