From 9ae934ffd7d95aa500b4ac5635c41a8cb00e545b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Tue, 16 Dec 2014 20:48:16 -0800 Subject: [PATCH] Included bgfx_shader.sh to bgfx_compute.sh. --- src/bgfx_compute.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/bgfx_compute.sh b/src/bgfx_compute.sh index 31395c0b0..575678eff 100644 --- a/src/bgfx_compute.sh +++ b/src/bgfx_compute.sh @@ -6,10 +6,17 @@ #ifndef BGFX_COMPUTE_H_HEADER_GUARD #define BGFX_COMPUTE_H_HEADER_GUARD +#include "bgfx_shader.sh" + #ifndef __cplusplus #if BGFX_SHADER_LANGUAGE_HLSL +float uintBitsToFloat(uint _x) { return asfloat(_x); } +uint floatBitsToUint(float _x) { return asuint(_x); } + +#define SHARED groupshared + #define IMAGE2D_RO(_name, _reg) Texture2D _name : register(t[_reg]) #define IMAGE2D_RW(_name, _reg) RWTexture2D _name : register(u[_reg]) #define IMAGE2D_WR(_name, _reg) IMAGE2D_RW(_name, _reg) @@ -95,6 +102,8 @@ uint atomicCompSwap(uint _mem, uint _compare, uint _data) #else +#define SHARED shared + #define __IMAGE2D_XX(_name, _reg, _access) \ layout(rgba8, binding=_reg) _access uniform highp image2D _name