Skip to content

Commit

Permalink
Fixed 'unexpected EOL' when building shaders. Added error message for…
Browse files Browse the repository at this point in the history
… missing shader entry point.
  • Loading branch information
bkaradzic committed Feb 15, 2013
1 parent 8511cef commit cc69b20
Show file tree
Hide file tree
Showing 7 changed files with 181 additions and 170 deletions.
10 changes: 0 additions & 10 deletions examples/06-bump/fs_bump.sc
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,6 @@ vec4 powRgba(vec4 _rgba, float _pow)
return result;
}

vec4 toLinear(vec4 _rgba)
{
return powRgba(_rgba, 2.2);
}

vec4 toGamma(vec4 _rgba)
{
return powRgba(_rgba, 1.0/2.2);
}

vec3 calcLight(int _idx, mat3 _tbn, vec3 _wpos, vec3 _normal, vec3 _view)
{
vec3 lp = u_lightPosRadius[_idx].xyz - _wpos;
Expand Down
Binary file modified examples/runtime/shaders/gles/fs_bump.bin
Binary file not shown.
Binary file modified examples/runtime/shaders/glsl/fs_bump.bin
Binary file not shown.
10 changes: 10 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,16 @@ osx-release64:
make -C .build/projects/gmake-osx config=release64
osx: osx-debug32 osx-release32 osx-debug64 osx-release64

rebuild-shaders:
make -C examples/01-cubes rebuild
make -C examples/02-metaballs rebuild
make -C examples/03-raymarch rebuild
make -C examples/04-mesh rebuild
make -C examples/05-instancing rebuild
make -C examples/06-bump rebuild
make -C examples/07-callback rebuild
make -C examples/08-update rebuild

docs:
markdown README.md > .build/docs/readme.html

Expand Down
20 changes: 12 additions & 8 deletions src/dds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ namespace bgfx
#define DDS_DXT4 BX_MAKEFOURCC('D', 'X', 'T', '4')
#define DDS_DXT5 BX_MAKEFOURCC('D', 'X', 'T', '5')
#define DDS_ATI1 BX_MAKEFOURCC('A', 'T', 'I', '1')
#define DDS_BC4U BX_MAKEFOURCC('B', 'C', '4', 'U')
#define DDS_ATI2 BX_MAKEFOURCC('A', 'T', 'I', '2')
#define DDS_BC5U BX_MAKEFOURCC('B', 'C', '5', 'U')

#define D3DFMT_A16B16G16R16 36
#define D3DFMT_A16B16G16R16F 113
Expand Down Expand Up @@ -466,34 +468,36 @@ bool parseDds(Dds& _dds, const Memory* _mem)
{
case DDS_DXT1:
type = TextureFormat::BC1;
blockSize = 8;
bpp = 4;
blockSize = 4*4*bpp/8;
break;

case DDS_DXT2:
case DDS_DXT3:
type = TextureFormat::BC2;
blockSize = 16;
bpp = 4;
bpp = 8;
blockSize = 4*4*bpp/8;
break;

case DDS_DXT4:
case DDS_DXT5:
type = TextureFormat::BC3;
blockSize = 16;
bpp = 4;
bpp = 8;
blockSize = 4*4*bpp/8;
break;

case DDS_ATI1:
case DDS_BC4U:
type = TextureFormat::BC4;
blockSize = 16;
bpp = 4;
blockSize = 4*4*bpp/8;
break;

case DDS_ATI2:
case DDS_BC5U:
type = TextureFormat::BC5;
blockSize = 16;
bpp = 4;
bpp = 8;
blockSize = 4*4*bpp/8;
break;

case D3DFMT_A16B16G16R16:
Expand Down
Binary file modified tools/bin/shaderc.exe
Binary file not shown.

0 comments on commit cc69b20

Please sign in to comment.