diff --git a/src/bgfx_compute.sh b/src/bgfx_compute.sh index a58ae1ddf..2bef24d24 100644 --- a/src/bgfx_compute.sh +++ b/src/bgfx_compute.sh @@ -50,11 +50,10 @@ #define __IMAGE_IMPL(_textureType, _storeComponents, _type, _loadComponents) \ _type imageLoad( Texture2D<_textureType> _image, ivec2 _uv) { return _image[_uv ]._loadComponents; } \ + _type imageLoad( RWTexture2D<_textureType> _image, ivec2 _uv) { return _image[_uv ]._loadComponents; } \ _type imageLoad(RWTexture2DArray<_textureType> _image, ivec3 _uvw) { return _image[_uvw ]._loadComponents; } \ _type imageLoad( Texture3D<_textureType> _image, ivec3 _uvw) { return _image[_uvw]._loadComponents; } \ - _type imageLoad( RWTexture2D<_textureType> _image, ivec2 _uv) { return _image[_uv ]._loadComponents; } \ - _type imageLoad(RWTexture2DArray<_textureType> _image, ivec3 _uvw, _type _value) { return _image[_uvw]._loadComponents; } \ - _type imageLoad( RWTexture3D<_textureType> _image, ivec3 _uvw, _type _value) { return _image[_uvw]._loadComponents; } \ + _type imageLoad( RWTexture3D<_textureType> _image, ivec3 _uvw) { return _image[_uvw]._loadComponents; } \ void imageStore( RWTexture2D<_textureType> _image, ivec2 _uv, _type _value) { _image[_uv ] = _value._storeComponents; } \ void imageStore(RWTexture2DArray<_textureType> _image, ivec3 _uvw, _type _value) { _image[_uvw] = _value._storeComponents; } \ void imageStore( RWTexture3D<_textureType> _image, ivec3 _uvw, _type _value) { _image[_uvw] = _value._storeComponents; } diff --git a/src/bgfx_shader.sh b/src/bgfx_shader.sh index 3ee69e85e..2f66baf6e 100644 --- a/src/bgfx_shader.sh +++ b/src/bgfx_shader.sh @@ -28,6 +28,14 @@ # define EARLY_DEPTH_STENCIL #endif // BGFX_SHADER_LANGUAGE_HLSL > 3 && BGFX_SHADER_TYPE_FRAGMENT +#if BGFX_SHADER_LANGUAGE_GLSL +# define ARRAY_BEGIN(_type, _name, _count) _type _name[_count] = _type[]( +# define ARRAY_END() ) +#else +# define ARRAY_BEGIN(_type, _name, _count) _type _name[_count] = { +# define ARRAY_END() } +#endif // BGFX_SHADER_LANGUAGE_GLSL + #if BGFX_SHADER_LANGUAGE_HLSL || BGFX_SHADER_LANGUAGE_PSSL || BGFX_SHADER_LANGUAGE_SPIRV # define CONST(_x) static const _x # define dFdx(_x) ddx(_x)