diff options
Diffstat (limited to 'tests/python_build/fixtures/rd_glsl')
7 files changed, 150 insertions, 0 deletions
diff --git a/tests/python_build/fixtures/rd_glsl/_included.glsl b/tests/python_build/fixtures/rd_glsl/_included.glsl new file mode 100644 index 0000000000..adf5f702d3 --- /dev/null +++ b/tests/python_build/fixtures/rd_glsl/_included.glsl @@ -0,0 +1 @@ +#define M_PI 3.14159265359 diff --git a/tests/python_build/fixtures/rd_glsl/compute.glsl b/tests/python_build/fixtures/rd_glsl/compute.glsl new file mode 100644 index 0000000000..66fbbeb401 --- /dev/null +++ b/tests/python_build/fixtures/rd_glsl/compute.glsl @@ -0,0 +1,13 @@ +#[compute] + +#version 450 + +#VERSION_DEFINES + +#define BLOCK_SIZE 8 + +#include "_included.glsl" + +void main() { + uint t = BLOCK_SIZE + 1; +} diff --git a/tests/python_build/fixtures/rd_glsl/compute_expected_full.glsl b/tests/python_build/fixtures/rd_glsl/compute_expected_full.glsl new file mode 100644 index 0000000000..b59923e28a --- /dev/null +++ b/tests/python_build/fixtures/rd_glsl/compute_expected_full.glsl @@ -0,0 +1,20 @@ +/* WARNING, THIS FILE WAS GENERATED, DO NOT EDIT */ +#ifndef COMPUTE_GLSL_GEN_H_RD +#define COMPUTE_GLSL_GEN_H_RD + +#include "servers/rendering/renderer_rd/shader_rd.h" + +class ComputeShaderRD : public ShaderRD { + +public: + + ComputeShaderRD() { + + static const char _compute_code[] = { +10,35,118,101,114,115,105,111,110,32,52,53,48,10,10,35,86,69,82,83,73,79,78,95,68,69,70,73,78,69,83,10,10,35,100,101,102,105,110,101,32,66,76,79,67,75,95,83,73,90,69,32,56,10,10,35,100,101,102,105,110,101,32,77,95,80,73,32,51,46,49,52,49,53,57,50,54,53,51,53,57,10,10,118,111,105,100,32,109,97,105,110,40,41,32,123,10,9,117,105,110,116,32,116,32,61,32,66,76,79,67,75,95,83,73,90,69,32,43,32,49,59,10,125,10,0 + }; + setup(nullptr, nullptr, _compute_code, "ComputeShaderRD"); + } +}; + +#endif diff --git a/tests/python_build/fixtures/rd_glsl/compute_expected_parts.json b/tests/python_build/fixtures/rd_glsl/compute_expected_parts.json new file mode 100644 index 0000000000..26ba9e4fc4 --- /dev/null +++ b/tests/python_build/fixtures/rd_glsl/compute_expected_parts.json @@ -0,0 +1,28 @@ +{ + "vertex_lines": [], + "fragment_lines": [], + "compute_lines": [ + "", + "#version 450", + "", + "#VERSION_DEFINES", + "", + "#define BLOCK_SIZE 8", + "", + "#define M_PI 3.14159265359", + "", + "void main() {", + "\tuint t = BLOCK_SIZE + 1;", + "}" + ], + "vertex_included_files": [], + "fragment_included_files": [], + "compute_included_files": [ + "tests/python_build/fixtures/rd_glsl/_included.glsl" + ], + "reading": "compute", + "line_offset": 13, + "vertex_offset": 0, + "fragment_offset": 0, + "compute_offset": 1 +} diff --git a/tests/python_build/fixtures/rd_glsl/vertex_fragment.glsl b/tests/python_build/fixtures/rd_glsl/vertex_fragment.glsl new file mode 100644 index 0000000000..27be08a857 --- /dev/null +++ b/tests/python_build/fixtures/rd_glsl/vertex_fragment.glsl @@ -0,0 +1,25 @@ +#[vertex] + +#version 450 + +#VERSION_DEFINES + +#include "_included.glsl" + +layout(location = 0) out vec2 uv_interp; + +void main() { + uv_interp = vec2(0, 1); +} + +#[fragment] + +#version 450 + +#VERSION_DEFINES + +layout(location = 0) in vec2 uv_interp; + +void main() { + uv_interp = vec2(1, 0); +} diff --git a/tests/python_build/fixtures/rd_glsl/vertex_fragment_expected_full.glsl b/tests/python_build/fixtures/rd_glsl/vertex_fragment_expected_full.glsl new file mode 100644 index 0000000000..ff804dbf89 --- /dev/null +++ b/tests/python_build/fixtures/rd_glsl/vertex_fragment_expected_full.glsl @@ -0,0 +1,23 @@ +/* WARNING, THIS FILE WAS GENERATED, DO NOT EDIT */ +#ifndef VERTEX_FRAGMENT_GLSL_GEN_H_RD +#define VERTEX_FRAGMENT_GLSL_GEN_H_RD + +#include "servers/rendering/renderer_rd/shader_rd.h" + +class VertexFragmentShaderRD : public ShaderRD { + +public: + + VertexFragmentShaderRD() { + + static const char _vertex_code[] = { +10,35,118,101,114,115,105,111,110,32,52,53,48,10,10,35,86,69,82,83,73,79,78,95,68,69,70,73,78,69,83,10,10,35,100,101,102,105,110,101,32,77,95,80,73,32,51,46,49,52,49,53,57,50,54,53,51,53,57,10,10,108,97,121,111,117,116,40,108,111,99,97,116,105,111,110,32,61,32,48,41,32,111,117,116,32,118,101,99,50,32,117,118,95,105,110,116,101,114,112,59,10,10,118,111,105,100,32,109,97,105,110,40,41,32,123,10,9,117,118,95,105,110,116,101,114,112,32,61,32,118,101,99,50,40,48,44,32,49,41,59,10,125,10,10,0 + }; + static const char _fragment_code[] = { +10,35,118,101,114,115,105,111,110,32,52,53,48,10,10,35,86,69,82,83,73,79,78,95,68,69,70,73,78,69,83,10,10,108,97,121,111,117,116,40,108,111,99,97,116,105,111,110,32,61,32,48,41,32,105,110,32,118,101,99,50,32,117,118,95,105,110,116,101,114,112,59,10,10,118,111,105,100,32,109,97,105,110,40,41,32,123,10,9,117,118,95,105,110,116,101,114,112,32,61,32,118,101,99,50,40,49,44,32,48,41,59,10,125,10,0 + }; + setup(_vertex_code, _fragment_code, nullptr, "VertexFragmentShaderRD"); + } +}; + +#endif diff --git a/tests/python_build/fixtures/rd_glsl/vertex_fragment_expected_parts.json b/tests/python_build/fixtures/rd_glsl/vertex_fragment_expected_parts.json new file mode 100644 index 0000000000..dbf833edea --- /dev/null +++ b/tests/python_build/fixtures/rd_glsl/vertex_fragment_expected_parts.json @@ -0,0 +1,40 @@ +{ + "vertex_lines": [ + "", + "#version 450", + "", + "#VERSION_DEFINES", + "", + "#define M_PI 3.14159265359", + "", + "layout(location = 0) out vec2 uv_interp;", + "", + "void main() {", + "\tuv_interp = vec2(0, 1);", + "}", + "" + ], + "fragment_lines": [ + "", + "#version 450", + "", + "#VERSION_DEFINES", + "", + "layout(location = 0) in vec2 uv_interp;", + "", + "void main() {", + "\tuv_interp = vec2(1, 0);", + "}" + ], + "compute_lines": [], + "vertex_included_files": [ + "tests/python_build/fixtures/rd_glsl/_included.glsl" + ], + "fragment_included_files": [], + "compute_included_files": [], + "reading": "fragment", + "line_offset": 25, + "vertex_offset": 1, + "fragment_offset": 15, + "compute_offset": 0 +} |