浏览代码

fix shader compile errors when target platform doesn't support compute-shader

/main
xingwei.zhu 5 年前
当前提交
10767217
共有 12 个文件被更改,包括 37 次插入3 次删除
  1. 2
      Runtime/Resources/shaders/computebuffer/UIWidgets_canvas_cb.cginc
  2. 5
      Runtime/Resources/shaders/computebuffer/UIWidgets_canvas_convexFill_cb.shader
  3. 1
      Runtime/Resources/shaders/computebuffer/UIWidgets_canvas_fill0_cb.shader
  4. 5
      Runtime/Resources/shaders/computebuffer/UIWidgets_canvas_fill1_cb.shader
  5. 1
      Runtime/Resources/shaders/computebuffer/UIWidgets_canvas_filter_cb.shader
  6. 3
      Runtime/Resources/shaders/computebuffer/UIWidgets_canvas_shadowBox_cb.shader
  7. 4
      Runtime/Resources/shaders/computebuffer/UIWidgets_canvas_shadowRBox_cb.shader
  8. 3
      Runtime/Resources/shaders/computebuffer/UIWidgets_canvas_stencil_cb.shader
  9. 5
      Runtime/Resources/shaders/computebuffer/UIWidgets_canvas_stroke0_cb.shader
  10. 1
      Runtime/Resources/shaders/computebuffer/UIWidgets_canvas_stroke1_cb.shader
  11. 5
      Runtime/Resources/shaders/computebuffer/UIWidgets_canvas_strokeAlpha_cb.shader
  12. 5
      Runtime/Resources/shaders/computebuffer/UIWidgets_canvas_tex_cb.shader

2
Runtime/Resources/shaders/computebuffer/UIWidgets_canvas_cb.cginc


StructuredBuffer<int> indexbuffer;
int _startVertex;
v2f vert_compute (uint vertex_id: SV_VertexID, uint instance_id: SV_InstanceID)
v2f vert_compute (uint vertex_id: SV_VertexID)
{
v2f o = (v2f)0;
vdata v = databuffer[indexbuffer[_startVertex + vertex_id]];

5
Runtime/Resources/shaders/computebuffer/UIWidgets_canvas_convexFill_cb.shader


Pass { // 0, color
CGPROGRAM
#pragma require compute
#define UIWIDGETS_COLOR
#include "../UIWidgets_canvas.cginc"
#include "UIWidgets_canvas_cb.cginc"

Pass { // 1, linear
CGPROGRAM
#pragma require compute
#define UIWIDGETS_LINEAR
#include "../UIWidgets_canvas.cginc"
#include "UIWidgets_canvas_cb.cginc"

Pass { // 2, radial
CGPROGRAM
#pragma require compute
#define UIWIDGETS_RADIAL
#include "../UIWidgets_canvas.cginc"
#include "UIWidgets_canvas_cb.cginc"

Pass { // 3, sweep
CGPROGRAM
#pragma require compute
#define UIWIDGETS_SWEEP
#include "../UIWidgets_canvas.cginc"
#include "UIWidgets_canvas_cb.cginc"

Pass { // 4, image
CGPROGRAM
#pragma require compute
#define UIWIDGETS_IMAGE
#include "../UIWidgets_canvas.cginc"
#include "UIWidgets_canvas_cb.cginc"

1
Runtime/Resources/shaders/computebuffer/UIWidgets_canvas_fill0_cb.shader


Pass {
CGPROGRAM
#pragma require compute
#include "../UIWidgets_canvas.cginc"
#include "UIWidgets_canvas_cb.cginc"
#pragma vertex vert_compute

5
Runtime/Resources/shaders/computebuffer/UIWidgets_canvas_fill1_cb.shader


Pass { // 0, color
CGPROGRAM
#pragma require compute
#define UIWIDGETS_COLOR
#include "../UIWidgets_canvas.cginc"
#include "UIWidgets_canvas_cb.cginc"

Pass { // 1, linear
CGPROGRAM
#pragma require compute
#define UIWIDGETS_LINEAR
#include "../UIWidgets_canvas.cginc"
#include "UIWidgets_canvas_cb.cginc"

Pass { // 2, radial
CGPROGRAM
#pragma require compute
#define UIWIDGETS_RADIAL
#include "../UIWidgets_canvas.cginc"
#include "UIWidgets_canvas_cb.cginc"

Pass { // 3, sweep
CGPROGRAM
#pragma require compute
#define UIWIDGETS_SWEEP
#include "../UIWidgets_canvas.cginc"
#include "UIWidgets_canvas_cb.cginc"

Pass { // 4, image
CGPROGRAM
#pragma require compute
#define UIWIDGETS_IMAGE
#include "../UIWidgets_canvas.cginc"
#include "UIWidgets_canvas_cb.cginc"

1
Runtime/Resources/shaders/computebuffer/UIWidgets_canvas_filter_cb.shader


Pass { // 0, mask filter
CGPROGRAM
#pragma require compute
#include "../UIWidgets_canvas.cginc"
#include "UIWidgets_canvas_cb.cginc"
#pragma vertex vert_compute

3
Runtime/Resources/shaders/computebuffer/UIWidgets_canvas_shadowBox_cb.shader


Pass {
CGPROGRAM
#pragma require compute
float4 _sb_box;
float4 _viewport;

return (integral.z - integral.x) * (integral.w - integral.y);
}
v2f vert(uint vertex_id: SV_VertexID, uint instance_id: SV_InstanceID){
v2f vert(uint vertex_id: SV_VertexID){
v2f o;
vdata v = databuffer[indexbuffer[_startVertex + vertex_id]];
float padding = 3.0 * _sb_sigma;

4
Runtime/Resources/shaders/computebuffer/UIWidgets_canvas_shadowRBox_cb.shader


Pass {
CGPROGRAM
#pragma require compute
float4 _sb_box;
float4 _viewport;
float _sb_sigma;

return value;
}
v2f vert(uint vertex_id: SV_VertexID, uint instance_id: SV_InstanceID){
v2f vert(uint vertex_id: SV_VertexID){
v2f o;
vdata v = databuffer[indexbuffer[_startVertex + vertex_id]];
float padding = 3.0 * _sb_sigma;

3
Runtime/Resources/shaders/computebuffer/UIWidgets_canvas_stencil_cb.shader


}
CGPROGRAM
#pragma require compute
#include "../UIWidgets_canvas.cginc"
#include "UIWidgets_canvas_cb.cginc"
#pragma vertex vert_compute

}
CGPROGRAM
#pragma require compute
#include "../UIWidgets_canvas.cginc"
#include "UIWidgets_canvas_cb.cginc"
#pragma vertex vert_compute

}
CGPROGRAM
#pragma require compute
#include "../UIWidgets_canvas.cginc"
#include "UIWidgets_canvas_cb.cginc"
#pragma vertex vert_compute

5
Runtime/Resources/shaders/computebuffer/UIWidgets_canvas_stroke0_cb.shader


Pass { // 0, color
CGPROGRAM
#pragma require compute
#define UIWIDGETS_COLOR
#include "../UIWidgets_canvas.cginc"
#include "UIWidgets_canvas_cb.cginc"

Pass { // 1, linear
CGPROGRAM
#pragma require compute
#define UIWIDGETS_LINEAR
#include "../UIWidgets_canvas.cginc"
#include "UIWidgets_canvas_cb.cginc"

Pass { // 2, radial
CGPROGRAM
#pragma require compute
#define UIWIDGETS_RADIAL
#include "../UIWidgets_canvas.cginc"
#include "UIWidgets_canvas_cb.cginc"

Pass { // 3, sweep
CGPROGRAM
#pragma require compute
#define UIWIDGETS_SWEEP
#include "../UIWidgets_canvas.cginc"
#include "UIWidgets_canvas_cb.cginc"

Pass { // 4, image
CGPROGRAM
#pragma require compute
#define UIWIDGETS_IMAGE
#include "../UIWidgets_canvas.cginc"
#include "UIWidgets_canvas_cb.cginc"

1
Runtime/Resources/shaders/computebuffer/UIWidgets_canvas_stroke1_cb.shader


Pass {
CGPROGRAM
#pragma require compute
#include "../UIWidgets_canvas.cginc"
#include "UIWidgets_canvas_cb.cginc"
#pragma vertex vert_compute

5
Runtime/Resources/shaders/computebuffer/UIWidgets_canvas_strokeAlpha_cb.shader


Pass { // 0, color
CGPROGRAM
#pragma require compute
#define UIWIDGETS_COLOR
#include "../UIWidgets_canvas.cginc"
#include "UIWidgets_canvas_cb.cginc"

Pass { // 1, linear
CGPROGRAM
#pragma require compute
#define UIWIDGETS_LINEAR
#include "../UIWidgets_canvas.cginc"
#include "UIWidgets_canvas_cb.cginc"

Pass { // 2, radial
CGPROGRAM
#pragma require compute
#define UIWIDGETS_RADIAL
#include "../UIWidgets_canvas.cginc"
#include "UIWidgets_canvas_cb.cginc"

Pass { // 3, sweep
CGPROGRAM
#pragma require compute
#define UIWIDGETS_SWEEP
#include "../UIWidgets_canvas.cginc"
#include "UIWidgets_canvas_cb.cginc"

Pass { // 4, image
CGPROGRAM
#pragma require compute
#define UIWIDGETS_IMAGE
#include "../UIWidgets_canvas.cginc"
#include "UIWidgets_canvas_cb.cginc"

5
Runtime/Resources/shaders/computebuffer/UIWidgets_canvas_tex_cb.shader


Pass { // 0, color
CGPROGRAM
#pragma require compute
#define UIWIDGETS_COLOR
#include "../UIWidgets_canvas.cginc"
#include "UIWidgets_canvas_cb.cginc"

Pass { // 1, linear
CGPROGRAM
#pragma require compute
#define UIWIDGETS_LINEAR
#include "../UIWidgets_canvas.cginc"
#include "UIWidgets_canvas_cb.cginc"

Pass { // 2, radial
CGPROGRAM
#pragma require compute
#define UIWIDGETS_RADIAL
#include "../UIWidgets_canvas.cginc"
#include "UIWidgets_canvas_cb.cginc"

Pass { // 3, sweep
CGPROGRAM
#pragma require compute
#define UIWIDGETS_SWEEP
#include "../UIWidgets_canvas.cginc"
#include "UIWidgets_canvas_cb.cginc"

Pass { // 4, image
CGPROGRAM
#pragma require compute
#define UIWIDGETS_IMAGE
#include "../UIWidgets_canvas.cginc"
#include "UIWidgets_canvas_cb.cginc"

正在加载...
取消
保存