Skip to content

Commit ea2772d

Browse files
SonicMastrhalotroop2288
authored andcommitted
Vita
Signed-off-by: Caroline Bell <halotroop2288@proton.me>
1 parent e0e68ce commit ea2772d

39 files changed

+2877
-53
lines changed

.github/workflows/runner.yml

+5
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,8 @@ jobs:
4949
name: 🔄 Switch
5050
needs: static-checks
5151
uses: ./.github/workflows/switch_builds.yml
52+
53+
vita-build:
54+
name: 🌱 PSVita
55+
needs: static-checks
56+
uses: ./.github/workflows/vita_builds.yml

.github/workflows/vita_builds.yml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: 🌱 PSVita Builds
2+
on:
3+
workflow_call:
4+
5+
# Global Settings
6+
env:
7+
GODOT_BASE_BRANCH: 3.5
8+
SCONSFLAGS: verbose=yes warnings=all werror=no debug_symbols=no
9+
VITASDK: /usr/local/vitasdk
10+
EUID: 1 makepkg
11+
12+
concurrency:
13+
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-vita
14+
cancel-in-progress: true
15+
16+
jobs:
17+
vita-template:
18+
runs-on: "ubuntu-20.04"
19+
name: Template (target=release, tools=no)
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
24+
# Azure repositories are not reliable, we need to prevent azure giving us packages.
25+
- name: Make apt sources.list use the default Ubuntu repositories
26+
run: |
27+
sudo rm -f /etc/apt/sources.list.d/*
28+
sudo cp -f misc/ci/sources.list /etc/apt/sources.list
29+
sudo apt-get update
30+
- name: Setup Godot build cache
31+
uses: ./.github/actions/godot-cache
32+
continue-on-error: true
33+
34+
- name: Setup python and scons
35+
uses: ./.github/actions/godot-deps
36+
37+
- name: Setup VitaSDK
38+
run: |
39+
sudo apt-get install cmake libarchive-tools fakeroot zip -y
40+
git clone https://github.com/vitasdk/vdpm
41+
git clone https://github.com/isage/vita-packages-extra
42+
cd vdpm
43+
./bootstrap-vitasdk.sh
44+
./install-all.sh
45+
export PATH=$VITASDK/bin:$PATH
46+
vdpm vita-rss-libdl
47+
cd ../vita-packages-extra/pvr_psp2
48+
vita-makepkg
49+
vdpm *-arm.tar.xz
50+
- name: Compilation
51+
uses: ./.github/actions/godot-build
52+
with:
53+
sconsflags: ${{ env.SCONSFLAGS }}
54+
platform: vita
55+
target: release
56+
tools: false
57+
58+
- name: Upload artifact
59+
uses: ./.github/actions/upload-artifact

drivers/SCsub

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ SConscript("winmidi/SCsub")
2424

2525
# Graphics drivers
2626
if env["platform"] != "server":
27-
SConscript("gles3/SCsub")
27+
if env["platform"] != "vita":
28+
SConscript("gles3/SCsub")
2829
SConscript("gles2/SCsub")
2930
SConscript("gles_common/SCsub")
3031
SConscript("gl_context/SCsub")

drivers/gles2/rasterizer_gles2.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@
7676
#include <GLES2/gl2ext.h>
7777
#include <GLES2/gl2platform.h>
7878

79+
#ifdef VITA_ENABLED
80+
#include <psp2/types.h>
81+
#endif // VITA_ENABLED
82+
7983
#include <EGL/egl.h>
8084
#include <EGL/eglext.h>
8185
#endif

drivers/gles2/rasterizer_storage_gles2.cpp

+14-2
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,17 @@ PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC glFramebufferTexture2DMultisampleEXT
113113
#define glFramebufferTexture2DMultisample glFramebufferTexture2DMultisampleEXT
114114

115115
#elif defined(UWP_ENABLED)
116+
116117
#include <GLES2/gl2ext.h>
117118
#define glRenderbufferStorageMultisample glRenderbufferStorageMultisampleANGLE
118119
#define glFramebufferTexture2DMultisample glFramebufferTexture2DMultisampleANGLE
120+
121+
#elif defined(VITA_ENABLED)
122+
123+
#include <GLES2/gl2ext.h>
124+
#define glRenderbufferStorageMultisample glRenderbufferStorageMultisampleIMG
125+
#define glFramebufferTexture2DMultisample glFramebufferTexture2DMultisampleIMG
126+
119127
#endif
120128

121129
#define GL_TEXTURE_3D 0x806F
@@ -558,7 +566,7 @@ void RasterizerStorageGLES2::texture_allocate(RID p_texture, int p_width, int p_
558566
texture->images.resize(1);
559567
} break;
560568
case VS::TEXTURE_TYPE_EXTERNAL: {
561-
#ifdef ANDROID_ENABLED
569+
#if defined(ANDROID_ENABLED) || defined(VITA_ENABLED)
562570
texture->target = _GL_TEXTURE_EXTERNAL_OES;
563571
#else
564572
texture->target = GL_TEXTURE_2D;
@@ -1291,7 +1299,11 @@ void RasterizerStorageGLES2::sky_set_texture(RID p_sky, RID p_panorama, int p_ra
12911299
glCopyTexSubImage2D(_cube_side_enum[i], lod, 0, 0, 0, 0, size, size);
12921300
}
12931301

1302+
#ifdef VITA_ENABLED
1303+
size = 0;
1304+
#else // VITA_ENABLED
12941305
size >>= 1;
1306+
#endif // !VITA_ENABLED
12951307

12961308
mm_level--;
12971309

@@ -6349,7 +6361,7 @@ void RasterizerStorageGLES2::initialize() {
63496361
// If the desktop build is using S3TC, and you export / run from the IDE for android, if the device supports
63506362
// S3TC it will crash trying to load these textures, as they are not exported in the APK. This is a simple way
63516363
// to prevent Android devices trying to load S3TC, by faking lack of hardware support.
6352-
#if defined(ANDROID_ENABLED) || defined(IPHONE_ENABLED)
6364+
#if defined(ANDROID_ENABLED) || defined(IPHONE_ENABLED) || defined(VITA_ENABLED)
63536365
config.s3tc_supported = false;
63546366
#endif
63556367

drivers/gles2/shaders/canvas.glsl

+8-4
Original file line numberDiff line numberDiff line change
@@ -308,22 +308,26 @@ VERTEX_SHADER_CODE
308308

309309
// texture2DLodEXT and textureCubeLodEXT are fragment shader specific.
310310
// Do not copy these defines in the vertex section.
311+
#ifndef VITA_ENABLED
312+
311313
#ifndef USE_GLES_OVER_GL
312314
#ifdef GL_EXT_shader_texture_lod
313315
#extension GL_EXT_shader_texture_lod : enable
314316
#define texture2DLod(img, coord, lod) texture2DLodEXT(img, coord, lod)
315317
#define textureCubeLod(img, coord, lod) textureCubeLodEXT(img, coord, lod)
316-
#endif
318+
#endif // GL_EXT_shader_texture_lod
317319
#endif // !USE_GLES_OVER_GL
318320

319321
#ifdef GL_ARB_shader_texture_lod
320322
#extension GL_ARB_shader_texture_lod : enable
321-
#endif
323+
#endif // GL_ARB_shader_texture_lod
322324

323-
#if !defined(GL_EXT_shader_texture_lod) && !defined(GL_ARB_shader_texture_lod)
325+
#endif // !VITA_ENABLED
326+
327+
#if (!defined(GL_EXT_shader_texture_lod) && !defined(GL_ARB_shader_texture_lod)) || defined(VITA_ENABLED)
324328
#define texture2DLod(img, coord, lod) texture2D(img, coord, lod)
325329
#define textureCubeLod(img, coord, lod) textureCube(img, coord, lod)
326-
#endif
330+
#endif // (!GL_EXT_shader_texture_lod && !GL_ARB_shader_texture_lod) || VITA_ENABLED
327331

328332
#ifdef USE_GLES_OVER_GL
329333
#define lowp

drivers/gles2/shaders/cubemap_filter.glsl

+8-4
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,26 @@ void main() {
2626

2727
// texture2DLodEXT and textureCubeLodEXT are fragment shader specific.
2828
// Do not copy these defines in the vertex section.
29+
#ifndef VITA_ENABLED
30+
2931
#ifndef USE_GLES_OVER_GL
3032
#ifdef GL_EXT_shader_texture_lod
3133
#extension GL_EXT_shader_texture_lod : enable
3234
#define texture2DLod(img, coord, lod) texture2DLodEXT(img, coord, lod)
3335
#define textureCubeLod(img, coord, lod) textureCubeLodEXT(img, coord, lod)
34-
#endif
36+
#endif // GL_EXT_shader_texture_lod
3537
#endif // !USE_GLES_OVER_GL
3638

3739
#ifdef GL_ARB_shader_texture_lod
3840
#extension GL_ARB_shader_texture_lod : enable
39-
#endif
41+
#endif // GL_ARB_shader_texture_lod
4042

41-
#if !defined(GL_EXT_shader_texture_lod) && !defined(GL_ARB_shader_texture_lod)
43+
#endif // !VITA_ENABLED
44+
45+
#if (!defined(GL_EXT_shader_texture_lod) && !defined(GL_ARB_shader_texture_lod)) || defined(VITA_ENABLED)
4246
#define texture2DLod(img, coord, lod) texture2D(img, coord, lod)
4347
#define textureCubeLod(img, coord, lod) textureCube(img, coord, lod)
44-
#endif
48+
#endif // (!GL_EXT_shader_texture_lod && !GL_ARB_shader_texture_lod) || VITA_ENABLED
4549

4650
#ifdef USE_GLES_OVER_GL
4751
#define lowp

drivers/gles2/shaders/effect_blur.glsl

+8-4
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,26 @@ void main() {
3737

3838
// texture2DLodEXT and textureCubeLodEXT are fragment shader specific.
3939
// Do not copy these defines in the vertex section.
40+
#ifndef VITA_ENABLED
41+
4042
#ifndef USE_GLES_OVER_GL
4143
#ifdef GL_EXT_shader_texture_lod
4244
#extension GL_EXT_shader_texture_lod : enable
4345
#define texture2DLod(img, coord, lod) texture2DLodEXT(img, coord, lod)
4446
#define textureCubeLod(img, coord, lod) textureCubeLodEXT(img, coord, lod)
45-
#endif
47+
#endif // GL_EXT_shader_texture_lod
4648
#endif // !USE_GLES_OVER_GL
4749

4850
#ifdef GL_ARB_shader_texture_lod
4951
#extension GL_ARB_shader_texture_lod : enable
50-
#endif
52+
#endif // GL_ARB_shader_texture_lod
5153

52-
#if !defined(GL_EXT_shader_texture_lod) && !defined(GL_ARB_shader_texture_lod)
54+
#endif // !VITA_ENABLED
55+
56+
#if (!defined(GL_EXT_shader_texture_lod) && !defined(GL_ARB_shader_texture_lod)) || defined(VITA_ENABLED)
5357
#define texture2DLod(img, coord, lod) texture2D(img, coord, lod)
5458
#define textureCubeLod(img, coord, lod) textureCube(img, coord, lod)
55-
#endif
59+
#endif // (!GL_EXT_shader_texture_lod && !GL_ARB_shader_texture_lod) || VITA_ENABLED
5660

5761
#ifdef USE_GLES_OVER_GL
5862
#define lowp

drivers/gles2/shaders/scene.glsl

+18-4
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,9 @@ void light_compute(
235235
m_var = 0.662002687 * S1 + 0.684122060 * S2 - 0.323583601 * S3 - 0.0225411470 * m_var;\
236236
}
237237
*/
238+
#ifndef VITA_ENABLED
238239
#define SRGB_APPROX(m_var)
240+
#endif // VITA_ENABLED
239241

240242
float NdotL = dot(N, L);
241243
float cNdotL = max(NdotL, 0.0); // clamped NdotL
@@ -272,7 +274,9 @@ void light_compute(
272274
diffuse_brdf_NL = cNdotL * (1.0 / M_PI);
273275
#endif
274276

277+
#ifndef VITA_ENABLED
275278
SRGB_APPROX(diffuse_brdf_NL)
279+
#endif // VITA_ENABLED
276280

277281
diffuse_interp += light_color * diffuse_brdf_NL * attenuation;
278282

@@ -757,22 +761,26 @@ VERTEX_SHADER_CODE
757761

758762
// texture2DLodEXT and textureCubeLodEXT are fragment shader specific.
759763
// Do not copy these defines in the vertex section.
764+
#ifndef VITA_ENABLED
765+
760766
#ifndef USE_GLES_OVER_GL
761767
#ifdef GL_EXT_shader_texture_lod
762768
#extension GL_EXT_shader_texture_lod : enable
763769
#define texture2DLod(img, coord, lod) texture2DLodEXT(img, coord, lod)
764770
#define textureCubeLod(img, coord, lod) textureCubeLodEXT(img, coord, lod)
765-
#endif
771+
#endif // GL_EXT_shader_texture_lod
766772
#endif // !USE_GLES_OVER_GL
767773

768774
#ifdef GL_ARB_shader_texture_lod
769775
#extension GL_ARB_shader_texture_lod : enable
770-
#endif
776+
#endif // GL_ARB_shader_texture_lod
771777

772-
#if !defined(GL_EXT_shader_texture_lod) && !defined(GL_ARB_shader_texture_lod)
778+
#endif // !VITA_ENABLED
779+
780+
#if (!defined(GL_EXT_shader_texture_lod) && !defined(GL_ARB_shader_texture_lod)) || defined(VITA_ENABLED)
773781
#define texture2DLod(img, coord, lod) texture2D(img, coord, lod)
774782
#define textureCubeLod(img, coord, lod) textureCube(img, coord, lod)
775-
#endif
783+
#endif // (!GL_EXT_shader_texture_lod && !GL_ARB_shader_texture_lod) || VITA_ENABLED
776784

777785
#ifdef USE_GLES_OVER_GL
778786
#define lowp
@@ -1320,7 +1328,9 @@ void light_compute(
13201328
m_var = 0.662002687 * S1 + 0.684122060 * S2 - 0.323583601 * S3 - 0.0225411470 * m_var;\
13211329
}
13221330
*/
1331+
#ifndef VITA_ENABLED
13231332
#define SRGB_APPROX(m_var)
1333+
#endif // VITA_ENABLED
13241334

13251335
#if defined(USE_LIGHT_SHADER_CODE)
13261336
// light is written by the light shader
@@ -1413,7 +1423,9 @@ LIGHT_SHADER_CODE
14131423
diffuse_brdf_NL = cNdotL * (1.0 / M_PI);
14141424
#endif
14151425

1426+
#ifndef VITA_ENABLED
14161427
SRGB_APPROX(diffuse_brdf_NL)
1428+
#endif // VITA_ENABLED
14171429

14181430
diffuse_light += light_color * diffuse_color * diffuse_brdf_NL * attenuation;
14191431

@@ -1493,7 +1505,9 @@ LIGHT_SHADER_CODE
14931505

14941506
#endif
14951507

1508+
#ifndef VITA_ENABLED
14961509
SRGB_APPROX(specular_brdf_NL)
1510+
#endif // VITA_ENABLED
14971511
specular_light += specular_brdf_NL * light_color * specular_blob_intensity * attenuation;
14981512

14991513
#if defined(LIGHT_USE_CLEARCOAT)

drivers/gles2/shaders/tonemap.glsl

+8-4
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,26 @@ void main() {
2828

2929
// texture2DLodEXT and textureCubeLodEXT are fragment shader specific.
3030
// Do not copy these defines in the vertex section.
31+
#ifndef VITA_ENABLED
32+
3133
#ifndef USE_GLES_OVER_GL
3234
#ifdef GL_EXT_shader_texture_lod
3335
#extension GL_EXT_shader_texture_lod : enable
3436
#define texture2DLod(img, coord, lod) texture2DLodEXT(img, coord, lod)
3537
#define textureCubeLod(img, coord, lod) textureCubeLodEXT(img, coord, lod)
36-
#endif
38+
#endif // GL_EXT_shader_texture_lod
3739
#endif // !USE_GLES_OVER_GL
3840

3941
#ifdef GL_ARB_shader_texture_lod
4042
#extension GL_ARB_shader_texture_lod : enable
41-
#endif
43+
#endif // GL_ARB_shader_texture_lod
4244

43-
#if !defined(GL_EXT_shader_texture_lod) && !defined(GL_ARB_shader_texture_lod)
45+
#endif // !VITA_ENABLED
46+
47+
#if (!defined(GL_EXT_shader_texture_lod) && !defined(GL_ARB_shader_texture_lod)) || defined(VITA_ENABLED)
4448
#define texture2DLod(img, coord, lod) texture2D(img, coord, lod)
4549
#define textureCubeLod(img, coord, lod) textureCube(img, coord, lod)
46-
#endif
50+
#endif // (!GL_EXT_shader_texture_lod && !GL_ARB_shader_texture_lod) || VITA_ENABLED
4751

4852
// Allows the use of bitshift operators for bicubic upscale
4953
#ifdef GL_EXT_gpu_shader4

0 commit comments

Comments
 (0)