mirror of
https://github.com/love2d/megasource.git
synced 2026-08-18 03:34:25 +02:00
update SDL3 to libsdl-org/SDL@038a380 (3.3 development)
This commit is contained in:
@@ -32,14 +32,12 @@ if(NOT (MSVC AND SDL_CPU_ARM64))
|
||||
find_package(OpenGL)
|
||||
endif()
|
||||
|
||||
set(SDL_TEST_EXECUTABLES)
|
||||
|
||||
add_library(sdltests_utils OBJECT
|
||||
testutils.c
|
||||
)
|
||||
target_link_libraries(sdltests_utils PRIVATE SDL3::Headers)
|
||||
|
||||
file(GLOB RESOURCE_FILES *.bmp *.wav *.hex moose.dat utf8.txt)
|
||||
file(GLOB RESOURCE_FILES *.bmp *.wav *.csv *.hex moose.dat utf8.txt)
|
||||
|
||||
option(SDLTEST_TRACKMEM "Run tests with --trackmem" OFF)
|
||||
|
||||
@@ -101,7 +99,7 @@ define_property(TARGET PROPERTY SDL_NONINTERACTIVE BRIEF_DOCS "If true, target i
|
||||
define_property(TARGET PROPERTY SDL_NONINTERACTIVE_ARGUMENTS BRIEF_DOCS "Argument(s) to run executable in non-interactive mode." FULL_DOCS "Argument(s) to run executable in non-interactive mode.")
|
||||
define_property(TARGET PROPERTY SDL_NONINTERACTIVE_TIMEOUT BRIEF_DOCS "Timeout for noninteractive executable." FULL_DOCS "Timeout for noninteractive executable.")
|
||||
|
||||
macro(add_sdl_test_executable TARGET)
|
||||
function(add_sdl_test_executable TARGET)
|
||||
cmake_parse_arguments(AST "BUILD_DEPENDENT;NONINTERACTIVE;NEEDS_RESOURCES;TESTUTILS;THREADS;NO_C90;MAIN_CALLBACKS;NOTRACKMEM" "" "DEPENDS;DISABLE_THREADS_ARGS;NONINTERACTIVE_TIMEOUT;NONINTERACTIVE_ARGS;INSTALLED_ARGS;SOURCES" ${ARGN})
|
||||
if(AST_UNPARSED_ARGUMENTS)
|
||||
message(FATAL_ERROR "Unknown argument(s): ${AST_UNPARSED_ARGUMENTS}")
|
||||
@@ -133,7 +131,8 @@ macro(add_sdl_test_executable TARGET)
|
||||
add_dependencies(${TARGET} ${AST_DEPENDS})
|
||||
endif()
|
||||
|
||||
list(APPEND SDL_TEST_EXECUTABLES ${TARGET})
|
||||
set_propertY(TARGET ${TARGET} PROPERTY SDL_INSTALL "1")
|
||||
set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" APPEND PROPERTY SDL_TEST_EXECUTABLES "${TARGET}")
|
||||
set_property(TARGET ${TARGET} PROPERTY SDL_NOTRACKMEM ${AST_NOTRACKMEM})
|
||||
if(AST_NONINTERACTIVE)
|
||||
set_property(TARGET ${TARGET} PROPERTY SDL_NONINTERACTIVE 1)
|
||||
@@ -192,6 +191,14 @@ macro(add_sdl_test_executable TARGET)
|
||||
target_link_options(${TARGET} PRIVATE "SHELL:--pre-js ${CMAKE_CURRENT_SOURCE_DIR}/emscripten/pre.js")
|
||||
target_link_options(${TARGET} PRIVATE "-sEXIT_RUNTIME=1")
|
||||
set_property(TARGET ${TARGET} APPEND PROPERTY LINK_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/emscripten/pre.js")
|
||||
elseif(NGAGE)
|
||||
string(MD5 TARGET_MD5 "${TARGET}")
|
||||
string(SUBSTRING "${TARGET_MD5}" 0 8 TARGET_MD5_8)
|
||||
target_link_options(${TARGET} PRIVATE "SHELL:-s UID3=0x${TARGET_MD5_8}")
|
||||
if(NOT AST_MAIN_CALLBACKS)
|
||||
set_property(TARGET ${TARGET} PROPERTY "EXCLUDE_FROM_ALL" "1")
|
||||
set_propertY(TARGET ${TARGET} PROPERTY SDL_INSTALL "0")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(OPENGL_FOUND)
|
||||
@@ -200,10 +207,10 @@ macro(add_sdl_test_executable TARGET)
|
||||
|
||||
# FIXME: only add "${SDL3_BINARY_DIR}/include-config-$<LOWER_CASE:$<CONFIG>>" + include paths of external dependencies
|
||||
target_include_directories(${TARGET} PRIVATE "$<TARGET_PROPERTY:SDL3::${sdl_name_component},INCLUDE_DIRECTORIES>")
|
||||
endmacro()
|
||||
endfunction()
|
||||
|
||||
check_include_file(signal.h HAVE_SIGNAL_H)
|
||||
if(HAVE_SIGNAL_H)
|
||||
check_include_file(signal.h LIBC_HAS_SIGNAL_H)
|
||||
if(LIBC_HAS_SIGNAL_H)
|
||||
add_definitions(-DHAVE_SIGNAL_H)
|
||||
endif()
|
||||
|
||||
@@ -348,6 +355,8 @@ add_sdl_test_executable(testgl SOURCES testgl.c)
|
||||
add_sdl_test_executable(testgles SOURCES testgles.c)
|
||||
add_sdl_test_executable(testgpu_simple_clear SOURCES testgpu_simple_clear.c)
|
||||
add_sdl_test_executable(testgpu_spinning_cube SOURCES testgpu_spinning_cube.c)
|
||||
add_sdl_test_executable(testgpurender_effects MAIN_CALLBACKS NEEDS_RESOURCES TESTUTILS SOURCES testgpurender_effects.c)
|
||||
add_sdl_test_executable(testgpurender_msdf MAIN_CALLBACKS NEEDS_RESOURCES TESTUTILS SOURCES testgpurender_msdf.c)
|
||||
if(ANDROID)
|
||||
target_link_libraries(testgles PRIVATE GLESv1_CM)
|
||||
elseif(IOS OR TVOS)
|
||||
@@ -423,6 +432,8 @@ add_sdl_test_executable(testprocess
|
||||
add_sdl_test_executable(childprocess SOURCES childprocess.c)
|
||||
add_dependencies(testprocess childprocess)
|
||||
|
||||
get_property(SDL_TEST_EXECUTABLES DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" PROPERTY SDL_TEST_EXECUTABLES)
|
||||
|
||||
if (HAVE_WAYLAND)
|
||||
# Set the GENERATED property on the protocol file, since it is first created at build time
|
||||
set_property(SOURCE ${SDL3_BINARY_DIR}/wayland-generated-protocols/xdg-shell-protocol.c PROPERTY GENERATED 1)
|
||||
@@ -652,10 +663,15 @@ if(SDL_INSTALL_TESTS)
|
||||
DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/installed-tests/SDL3
|
||||
)
|
||||
else()
|
||||
install(
|
||||
TARGETS ${SDL_TEST_EXECUTABLES}
|
||||
DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/installed-tests/SDL3
|
||||
)
|
||||
foreach(test IN LISTS SDL_TEST_EXECUTABLES)
|
||||
get_property(install_target TARGET ${test} PROPERTY "SDL_INSTALL")
|
||||
if(install_target)
|
||||
install(
|
||||
TARGETS ${test}
|
||||
DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/installed-tests/SDL3
|
||||
)
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
if(MSVC)
|
||||
foreach(test IN LISTS SDL_TEST_EXECUTABLES)
|
||||
|
||||
@@ -8,7 +8,6 @@ import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
|
||||
import org.libsdl.app.SDL;
|
||||
import org.libsdl.app.SDLActivity;
|
||||
|
||||
import android.widget.Button;
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
make-header() {
|
||||
xxd -i "$1" | sed \
|
||||
-e 's/^unsigned /const unsigned /g' \
|
||||
-e 's,^const,static const,' \
|
||||
> "$1.h"
|
||||
}
|
||||
|
||||
# Requires shadercross CLI installed from SDL_shadercross
|
||||
for filename in *.hlsl; do
|
||||
if [ -f "$filename" ]; then
|
||||
shadercross "$filename" -o "${filename/.hlsl/.spv}"
|
||||
make-header "${filename/.hlsl/.spv}"
|
||||
shadercross "$filename" -o "${filename/.hlsl/.msl}"
|
||||
make-header "${filename/.hlsl/.msl}"
|
||||
shadercross "$filename" -o "${filename/.hlsl/.dxil}"
|
||||
make-header "${filename/.hlsl/.dxil}"
|
||||
fi
|
||||
done
|
||||
|
||||
rm -f *.spv *.msl *.dxil
|
||||
@@ -2,6 +2,11 @@
|
||||
#include <SDL3/SDL_main.h>
|
||||
#include <SDL3/SDL_test.h>
|
||||
|
||||
#ifdef SDL_PLATFORM_WINDOWS
|
||||
#include <io.h>
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
@@ -102,6 +107,11 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
if (print_arguments) {
|
||||
int print_i;
|
||||
#ifdef SDL_PLATFORM_WINDOWS
|
||||
/* reopen stdout as binary to prevent newline conversion */
|
||||
_setmode(_fileno(stdout), _O_BINARY);
|
||||
#endif
|
||||
|
||||
for (print_i = 0; i + print_i < argc; print_i++) {
|
||||
fprintf(stdout, "|%d=%s|\r\n", print_i, argv[i + print_i]);
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 32 KiB |
File diff suppressed because it is too large
Load Diff
+624
-12
@@ -16,6 +16,7 @@
|
||||
#include "gamepad_front.h"
|
||||
#include "gamepad_back.h"
|
||||
#include "gamepad_face_abxy.h"
|
||||
#include "gamepad_face_axby.h"
|
||||
#include "gamepad_face_bayx.h"
|
||||
#include "gamepad_face_sony.h"
|
||||
#include "gamepad_battery.h"
|
||||
@@ -29,6 +30,217 @@
|
||||
#include "gamepad_wired.h"
|
||||
#include "gamepad_wireless.h"
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
#define RAD_TO_DEG (180.0f / SDL_PI_F)
|
||||
|
||||
/* Used to draw a 3D cube to represent the gyroscope orientation */
|
||||
typedef struct
|
||||
{
|
||||
float x, y, z;
|
||||
} Vector3;
|
||||
|
||||
struct Quaternion
|
||||
{
|
||||
float x, y, z, w;
|
||||
};
|
||||
|
||||
static const Vector3 debug_cube_vertices[] = {
|
||||
{ -1.0f, -1.0f, -1.0f },
|
||||
{ 1.0f, -1.0f, -1.0f },
|
||||
{ 1.0f, 1.0f, -1.0f },
|
||||
{ -1.0f, 1.0f, -1.0f },
|
||||
{ -1.0f, -1.0f, 1.0f },
|
||||
{ 1.0f, -1.0f, 1.0f },
|
||||
{ 1.0f, 1.0f, 1.0f },
|
||||
{ -1.0f, 1.0f, 1.0f },
|
||||
};
|
||||
|
||||
static const int debug_cube_edges[][2] = {
|
||||
{ 0, 1 }, { 1, 2 }, { 2, 3 }, { 3, 0 }, /* bottom square */
|
||||
{ 4, 5 }, { 5, 6 }, { 6, 7 }, { 7, 4 }, /* top square */
|
||||
{ 0, 4 }, { 1, 5 }, { 2, 6 }, { 3, 7 }, /* verticals */
|
||||
};
|
||||
|
||||
static Vector3 RotateVectorByQuaternion(const Vector3 *v, const Quaternion *q) {
|
||||
/* v' = q * v * q^-1 */
|
||||
float x = v->x, y = v->y, z = v->z;
|
||||
float qx = q->x, qy = q->y, qz = q->z, qw = q->w;
|
||||
|
||||
/* Calculate quaternion *vector */
|
||||
float ix = qw * x + qy * z - qz * y;
|
||||
float iy = qw * y + qz * x - qx * z;
|
||||
float iz = qw * z + qx * y - qy * x;
|
||||
float iw = -qx * x - qy * y - qz * z;
|
||||
|
||||
/* Result = result * conjugate(q) */
|
||||
Vector3 out;
|
||||
out.x = ix * qw + iw * -qx + iy * -qz - iz * -qy;
|
||||
out.y = iy * qw + iw * -qy + iz * -qx - ix * -qz;
|
||||
out.z = iz * qw + iw * -qz + ix * -qy - iy * -qx;
|
||||
return out;
|
||||
}
|
||||
|
||||
#ifdef GYRO_ISOMETRIC_PROJECTION
|
||||
static SDL_FPoint ProjectVec3ToRect(const Vector3 *v, const SDL_FRect *rect)
|
||||
{
|
||||
SDL_FPoint out;
|
||||
/* Simple orthographic projection using X and Y; scale to fit into rect */
|
||||
out.x = rect->x + (rect->w / 2.0f) + (v->x * (rect->w / 2.0f));
|
||||
out.y = rect->y + (rect->h / 2.0f) - (v->y * (rect->h / 2.0f)); /* Y inverted */
|
||||
return out;
|
||||
}
|
||||
#else
|
||||
static SDL_FPoint ProjectVec3ToRect(const Vector3 *v, const SDL_FRect *rect)
|
||||
{
|
||||
const float verticalFOV_deg = 40.0f;
|
||||
const float cameraZ = 4.0f; /* Camera is at(0, 0, +4), looking toward origin */
|
||||
float aspect = rect->w / rect->h;
|
||||
|
||||
float fovScaleY = SDL_tanf((verticalFOV_deg * SDL_PI_F / 180.0f) * 0.5f);
|
||||
float fovScaleX = fovScaleY * aspect;
|
||||
|
||||
float relZ = cameraZ - v->z;
|
||||
if (relZ < 0.01f)
|
||||
relZ = 0.01f; /* Prevent division by 0 or negative depth */
|
||||
|
||||
float ndc_x = (v->x / relZ) / fovScaleX;
|
||||
float ndc_y = (v->y / relZ) / fovScaleY;
|
||||
|
||||
/* Convert to screen space */
|
||||
SDL_FPoint out;
|
||||
out.x = rect->x + (rect->w / 2.0f) + (ndc_x * rect->w / 2.0f);
|
||||
out.y = rect->y + (rect->h / 2.0f) - (ndc_y * rect->h / 2.0f); /* flip Y */
|
||||
return out;
|
||||
}
|
||||
#endif
|
||||
|
||||
void DrawGyroDebugCube(SDL_Renderer *renderer, const Quaternion *orientation, const SDL_FRect *rect)
|
||||
{
|
||||
SDL_FPoint projected[8];
|
||||
int i;
|
||||
for (i = 0; i < 8; ++i) {
|
||||
Vector3 rotated = RotateVectorByQuaternion(&debug_cube_vertices[i], orientation);
|
||||
projected[i] = ProjectVec3ToRect(&rotated, rect);
|
||||
}
|
||||
|
||||
for (i = 0; i < 12; ++i) {
|
||||
const SDL_FPoint p0 = projected[debug_cube_edges[i][0]];
|
||||
const SDL_FPoint p1 = projected[debug_cube_edges[i][1]];
|
||||
SDL_RenderLine(renderer, p0.x, p0.y, p1.x, p1.y);
|
||||
}
|
||||
}
|
||||
|
||||
#define CIRCLE_SEGMENTS 64
|
||||
|
||||
static Vector3 kCirclePoints3D_XY_Plane[CIRCLE_SEGMENTS];
|
||||
static Vector3 kCirclePoints3D_XZ_Plane[CIRCLE_SEGMENTS];
|
||||
static Vector3 kCirclePoints3D_YZ_Plane[CIRCLE_SEGMENTS];
|
||||
|
||||
void InitCirclePoints3D(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < CIRCLE_SEGMENTS; ++i) {
|
||||
float theta = ((float)i / CIRCLE_SEGMENTS) * SDL_PI_F * 2.0f;
|
||||
kCirclePoints3D_XY_Plane[i].x = SDL_cosf(theta);
|
||||
kCirclePoints3D_XY_Plane[i].y = SDL_sinf(theta);
|
||||
kCirclePoints3D_XY_Plane[i].z = 0.0f;
|
||||
}
|
||||
|
||||
for (i = 0; i < CIRCLE_SEGMENTS; ++i) {
|
||||
float theta = ((float)i / CIRCLE_SEGMENTS) * SDL_PI_F * 2.0f;
|
||||
kCirclePoints3D_XZ_Plane[i].x = SDL_cosf(theta);
|
||||
kCirclePoints3D_XZ_Plane[i].y = 0.0f;
|
||||
kCirclePoints3D_XZ_Plane[i].z = SDL_sinf(theta);
|
||||
}
|
||||
|
||||
for (i = 0; i < CIRCLE_SEGMENTS; ++i) {
|
||||
float theta = ((float)i / CIRCLE_SEGMENTS) * SDL_PI_F * 2.0f;
|
||||
kCirclePoints3D_YZ_Plane[i].x = 0.0f;
|
||||
kCirclePoints3D_YZ_Plane[i].y = SDL_cosf(theta);
|
||||
kCirclePoints3D_YZ_Plane[i].z = SDL_sinf(theta);
|
||||
}
|
||||
}
|
||||
|
||||
void DrawGyroCircle(
|
||||
SDL_Renderer *renderer,
|
||||
const Vector3 *circlePoints,
|
||||
int numSegments,
|
||||
const Quaternion *orientation,
|
||||
const SDL_FRect *bounds,
|
||||
Uint8 r, Uint8 g, Uint8 b, Uint8 a)
|
||||
{
|
||||
SDL_SetRenderDrawColor(renderer, r, g, b, a);
|
||||
|
||||
SDL_FPoint lastScreenPt = { 0 };
|
||||
bool hasLast = false;
|
||||
int i;
|
||||
for (i = 0; i <= numSegments; ++i) {
|
||||
int index = i % numSegments;
|
||||
|
||||
Vector3 rotated = RotateVectorByQuaternion(&circlePoints[index], orientation);
|
||||
SDL_FPoint screenPtVec2 = ProjectVec3ToRect(&rotated, bounds);
|
||||
SDL_FPoint screenPt;
|
||||
screenPt.x = screenPtVec2.x;
|
||||
screenPt.y = screenPtVec2.y;
|
||||
|
||||
|
||||
if (hasLast) {
|
||||
SDL_RenderLine(renderer, lastScreenPt.x, lastScreenPt.y, screenPt.x, screenPt.y);
|
||||
}
|
||||
|
||||
lastScreenPt = screenPt;
|
||||
hasLast = true;
|
||||
}
|
||||
}
|
||||
|
||||
void DrawGyroDebugCircle(SDL_Renderer *renderer, const Quaternion *orientation, const SDL_FRect *bounds)
|
||||
{
|
||||
/* Store current color */
|
||||
Uint8 r, g, b, a;
|
||||
SDL_GetRenderDrawColor(renderer, &r, &g, &b, &a);
|
||||
DrawGyroCircle(renderer, kCirclePoints3D_YZ_Plane, CIRCLE_SEGMENTS, orientation, bounds, GYRO_COLOR_RED); /* X axis - pitch */
|
||||
DrawGyroCircle(renderer, kCirclePoints3D_XZ_Plane, CIRCLE_SEGMENTS, orientation, bounds, GYRO_COLOR_GREEN); /* Y axis - yaw */
|
||||
DrawGyroCircle(renderer, kCirclePoints3D_XY_Plane, CIRCLE_SEGMENTS, orientation, bounds, GYRO_COLOR_BLUE); /* Z axis - Roll */
|
||||
|
||||
/* Restore current color */
|
||||
SDL_SetRenderDrawColor(renderer, r, g, b, a);
|
||||
}
|
||||
|
||||
void DrawAccelerometerDebugArrow(SDL_Renderer *renderer, const Quaternion *gyro_quaternion, const float *accel_data, const SDL_FRect *bounds)
|
||||
{
|
||||
/* Store current color */
|
||||
Uint8 r, g, b, a;
|
||||
SDL_GetRenderDrawColor(renderer, &r, &g, &b, &a);
|
||||
|
||||
const float flGravity = 9.81f;
|
||||
Vector3 vAccel;
|
||||
vAccel.x = accel_data[0] / flGravity;
|
||||
vAccel.y = accel_data[1] / flGravity;
|
||||
vAccel.z = accel_data[2] / flGravity;
|
||||
|
||||
Vector3 origin = { 0.0f, 0.0f, 0.0f };
|
||||
Vector3 rotated_accel = RotateVectorByQuaternion(&vAccel, gyro_quaternion);
|
||||
|
||||
/* Project the origin and rotated vector to screen space */
|
||||
SDL_FPoint origin_screen = ProjectVec3ToRect(&origin, bounds);
|
||||
SDL_FPoint accel_screen = ProjectVec3ToRect(&rotated_accel, bounds);
|
||||
|
||||
/* Draw the line from origin to the rotated accelerometer vector */
|
||||
SDL_SetRenderDrawColor(renderer, GYRO_COLOR_ORANGE);
|
||||
SDL_RenderLine(renderer, origin_screen.x, origin_screen.y, accel_screen.x, accel_screen.y);
|
||||
|
||||
const float head_width = 4.0f;
|
||||
SDL_FRect arrow_head_rect;
|
||||
arrow_head_rect.x = accel_screen.x - head_width * 0.5f;
|
||||
arrow_head_rect.y = accel_screen.y - head_width * 0.5f;
|
||||
arrow_head_rect.w = head_width;
|
||||
arrow_head_rect.h = head_width;
|
||||
SDL_RenderRect(renderer, &arrow_head_rect);
|
||||
|
||||
/* Restore current color */
|
||||
SDL_SetRenderDrawColor(renderer, r, g, b, a);
|
||||
}
|
||||
|
||||
/* This is indexed by gamepad element */
|
||||
static const struct
|
||||
@@ -95,6 +307,7 @@ struct GamepadImage
|
||||
SDL_Texture *front_texture;
|
||||
SDL_Texture *back_texture;
|
||||
SDL_Texture *face_abxy_texture;
|
||||
SDL_Texture *face_axby_texture;
|
||||
SDL_Texture *face_bayx_texture;
|
||||
SDL_Texture *face_sony_texture;
|
||||
SDL_Texture *connection_texture[2];
|
||||
@@ -159,6 +372,7 @@ GamepadImage *CreateGamepadImage(SDL_Renderer *renderer)
|
||||
SDL_GetTextureSize(ctx->front_texture, &ctx->gamepad_width, &ctx->gamepad_height);
|
||||
|
||||
ctx->face_abxy_texture = CreateTexture(renderer, gamepad_face_abxy_bmp, gamepad_face_abxy_bmp_len);
|
||||
ctx->face_axby_texture = CreateTexture(renderer, gamepad_face_axby_bmp, gamepad_face_axby_bmp_len);
|
||||
ctx->face_bayx_texture = CreateTexture(renderer, gamepad_face_bayx_bmp, gamepad_face_bayx_bmp_len);
|
||||
ctx->face_sony_texture = CreateTexture(renderer, gamepad_face_sony_bmp, gamepad_face_sony_bmp_len);
|
||||
SDL_GetTextureSize(ctx->face_abxy_texture, &ctx->face_width, &ctx->face_height);
|
||||
@@ -547,14 +761,17 @@ void RenderGamepadImage(GamepadImage *ctx)
|
||||
dst.w = ctx->face_width;
|
||||
dst.h = ctx->face_height;
|
||||
|
||||
switch (SDL_GetGamepadButtonLabelForType(ctx->type, SDL_GAMEPAD_BUTTON_SOUTH)) {
|
||||
case SDL_GAMEPAD_BUTTON_LABEL_A:
|
||||
switch (SDL_GetGamepadButtonLabelForType(ctx->type, SDL_GAMEPAD_BUTTON_EAST)) {
|
||||
case SDL_GAMEPAD_BUTTON_LABEL_B:
|
||||
SDL_RenderTexture(ctx->renderer, ctx->face_abxy_texture, NULL, &dst);
|
||||
break;
|
||||
case SDL_GAMEPAD_BUTTON_LABEL_B:
|
||||
case SDL_GAMEPAD_BUTTON_LABEL_X:
|
||||
SDL_RenderTexture(ctx->renderer, ctx->face_axby_texture, NULL, &dst);
|
||||
break;
|
||||
case SDL_GAMEPAD_BUTTON_LABEL_A:
|
||||
SDL_RenderTexture(ctx->renderer, ctx->face_bayx_texture, NULL, &dst);
|
||||
break;
|
||||
case SDL_GAMEPAD_BUTTON_LABEL_CROSS:
|
||||
case SDL_GAMEPAD_BUTTON_LABEL_CIRCLE:
|
||||
SDL_RenderTexture(ctx->renderer, ctx->face_sony_texture, NULL, &dst);
|
||||
break;
|
||||
default:
|
||||
@@ -664,6 +881,7 @@ void DestroyGamepadImage(GamepadImage *ctx)
|
||||
SDL_DestroyTexture(ctx->front_texture);
|
||||
SDL_DestroyTexture(ctx->back_texture);
|
||||
SDL_DestroyTexture(ctx->face_abxy_texture);
|
||||
SDL_DestroyTexture(ctx->face_axby_texture);
|
||||
SDL_DestroyTexture(ctx->face_bayx_texture);
|
||||
SDL_DestroyTexture(ctx->face_sony_texture);
|
||||
for (i = 0; i < SDL_arraysize(ctx->battery_texture); ++i) {
|
||||
@@ -676,7 +894,6 @@ void DestroyGamepadImage(GamepadImage *ctx)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static const char *gamepad_button_names[] = {
|
||||
"South",
|
||||
"East",
|
||||
@@ -729,6 +946,8 @@ struct GamepadDisplay
|
||||
|
||||
float accel_data[3];
|
||||
float gyro_data[3];
|
||||
float gyro_drift_correction_data[3];
|
||||
|
||||
Uint64 last_sensor_update;
|
||||
|
||||
ControllerDisplayMode display_mode;
|
||||
@@ -753,10 +972,68 @@ GamepadDisplay *CreateGamepadDisplay(SDL_Renderer *renderer)
|
||||
|
||||
ctx->element_highlighted = SDL_GAMEPAD_ELEMENT_INVALID;
|
||||
ctx->element_selected = SDL_GAMEPAD_ELEMENT_INVALID;
|
||||
|
||||
SDL_zeroa(ctx->accel_data);
|
||||
SDL_zeroa(ctx->gyro_data);
|
||||
SDL_zeroa(ctx->gyro_drift_correction_data);
|
||||
}
|
||||
return ctx;
|
||||
}
|
||||
|
||||
struct GyroDisplay
|
||||
{
|
||||
SDL_Renderer *renderer;
|
||||
|
||||
/* Main drawing area */
|
||||
SDL_FRect area;
|
||||
|
||||
/* This part displays extra info from the IMUstate in order to figure out actual polling rates. */
|
||||
float gyro_drift_solution[3];
|
||||
int reported_sensor_rate_hz; /*hz - comes from HIDsdl implementation. Could be fixed, platform time, or true sensor time*/
|
||||
int estimated_sensor_rate_hz; /*hz - our estimation of the actual polling rate by observing packets received*/
|
||||
float euler_displacement_angles[3]; /* pitch, yaw, roll */
|
||||
Quaternion gyro_quaternion; /* Rotation since startup/reset, comprised of each gyro speed packet times sensor delta time. */
|
||||
float drift_calibration_progress_frac; /* [0..1] */
|
||||
float accelerometer_noise_sq; /* Distance between last noise and new noise. Used to indicate motion.*/
|
||||
|
||||
GamepadButton *reset_gyro_button;
|
||||
GamepadButton *calibrate_gyro_button;
|
||||
};
|
||||
|
||||
GyroDisplay *CreateGyroDisplay(SDL_Renderer *renderer)
|
||||
{
|
||||
GyroDisplay *ctx = SDL_calloc(1, sizeof(*ctx));
|
||||
{
|
||||
ctx->renderer = renderer;
|
||||
ctx->estimated_sensor_rate_hz = 0;
|
||||
SDL_zeroa(ctx->gyro_drift_solution);
|
||||
Quaternion quat_identity = { 0.0f, 0.0f, 0.0f, 1.0f };
|
||||
ctx->gyro_quaternion = quat_identity;
|
||||
|
||||
ctx->reset_gyro_button = CreateGamepadButton(renderer, "Reset View");
|
||||
ctx->calibrate_gyro_button = CreateGamepadButton(renderer, "Recalibrate Drift");
|
||||
}
|
||||
|
||||
return ctx;
|
||||
}
|
||||
|
||||
void SetGyroDisplayArea(GyroDisplay *ctx, const SDL_FRect *area)
|
||||
{
|
||||
if (!ctx) {
|
||||
return;
|
||||
}
|
||||
|
||||
SDL_copyp(&ctx->area, area);
|
||||
|
||||
/* Place the reset button to the bottom right of the gyro display area.*/
|
||||
SDL_FRect reset_button_area;
|
||||
reset_button_area.w = SDL_max(MINIMUM_BUTTON_WIDTH, GetGamepadButtonLabelWidth(ctx->reset_gyro_button) + 2 * BUTTON_PADDING);
|
||||
reset_button_area.h = GetGamepadButtonLabelHeight(ctx->reset_gyro_button) + BUTTON_PADDING;
|
||||
reset_button_area.x = area->x + area->w - reset_button_area.w - BUTTON_PADDING;
|
||||
reset_button_area.y = area->y + area->h - reset_button_area.h - BUTTON_PADDING;
|
||||
SetGamepadButtonArea(ctx->reset_gyro_button, &reset_button_area);
|
||||
}
|
||||
|
||||
void SetGamepadDisplayDisplayMode(GamepadDisplay *ctx, ControllerDisplayMode display_mode)
|
||||
{
|
||||
if (!ctx) {
|
||||
@@ -774,6 +1051,16 @@ void SetGamepadDisplayArea(GamepadDisplay *ctx, const SDL_FRect *area)
|
||||
|
||||
SDL_copyp(&ctx->area, area);
|
||||
}
|
||||
void SetGamepadDisplayGyroDriftCorrection(GamepadDisplay *ctx, float *gyro_drift_correction)
|
||||
{
|
||||
if (!ctx) {
|
||||
return;
|
||||
}
|
||||
|
||||
ctx->gyro_drift_correction_data[0] = gyro_drift_correction[0];
|
||||
ctx->gyro_drift_correction_data[1] = gyro_drift_correction[1];
|
||||
ctx->gyro_drift_correction_data[2] = gyro_drift_correction[2];
|
||||
}
|
||||
|
||||
static bool GetBindingString(const char *label, const char *mapping, char *text, size_t size)
|
||||
{
|
||||
@@ -1037,6 +1324,50 @@ static void RenderGamepadElementHighlight(GamepadDisplay *ctx, int element, cons
|
||||
}
|
||||
}
|
||||
|
||||
bool BHasCachedGyroDriftSolution(GyroDisplay *ctx)
|
||||
{
|
||||
if (!ctx) {
|
||||
return false;
|
||||
}
|
||||
return (ctx->gyro_drift_solution[0] != 0.0f ||
|
||||
ctx->gyro_drift_solution[1] != 0.0f ||
|
||||
ctx->gyro_drift_solution[2] != 0.0f);
|
||||
}
|
||||
|
||||
void SetGamepadDisplayIMUValues(GyroDisplay *ctx, float *gyro_drift_solution, float *euler_displacement_angles, Quaternion *gyro_quaternion, int reported_senor_rate_hz, int estimated_sensor_rate_hz, float drift_calibration_progress_frac, float accelerometer_noise_sq)
|
||||
{
|
||||
if (!ctx) {
|
||||
return;
|
||||
}
|
||||
|
||||
SDL_memcpy(ctx->gyro_drift_solution, gyro_drift_solution, sizeof(ctx->gyro_drift_solution));
|
||||
ctx->estimated_sensor_rate_hz = estimated_sensor_rate_hz;
|
||||
|
||||
if (reported_senor_rate_hz != 0)
|
||||
ctx->reported_sensor_rate_hz = reported_senor_rate_hz;
|
||||
|
||||
SDL_memcpy(ctx->euler_displacement_angles, euler_displacement_angles, sizeof(ctx->euler_displacement_angles));
|
||||
ctx->gyro_quaternion = *gyro_quaternion;
|
||||
ctx->drift_calibration_progress_frac = drift_calibration_progress_frac;
|
||||
ctx->accelerometer_noise_sq = accelerometer_noise_sq;
|
||||
}
|
||||
|
||||
extern GamepadButton *GetGyroResetButton(GyroDisplay *ctx)
|
||||
{
|
||||
if (!ctx) {
|
||||
return NULL;
|
||||
}
|
||||
return ctx->reset_gyro_button;
|
||||
}
|
||||
|
||||
extern GamepadButton *GetGyroCalibrateButton(GyroDisplay *ctx)
|
||||
{
|
||||
if (!ctx) {
|
||||
return NULL;
|
||||
}
|
||||
return ctx->calibrate_gyro_button;
|
||||
}
|
||||
|
||||
void RenderGamepadDisplay(GamepadDisplay *ctx, SDL_Gamepad *gamepad)
|
||||
{
|
||||
float x, y;
|
||||
@@ -1278,6 +1609,7 @@ void RenderGamepadDisplay(GamepadDisplay *ctx, SDL_Gamepad *gamepad)
|
||||
|
||||
has_accel = SDL_GamepadHasSensor(gamepad, SDL_SENSOR_ACCEL);
|
||||
has_gyro = SDL_GamepadHasSensor(gamepad, SDL_SENSOR_GYRO);
|
||||
|
||||
if (has_accel || has_gyro) {
|
||||
const int SENSOR_UPDATE_INTERVAL_MS = 100;
|
||||
Uint64 now = SDL_GetTicks();
|
||||
@@ -1295,20 +1627,31 @@ void RenderGamepadDisplay(GamepadDisplay *ctx, SDL_Gamepad *gamepad)
|
||||
if (has_accel) {
|
||||
SDL_strlcpy(text, "Accelerometer:", sizeof(text));
|
||||
SDLTest_DrawString(ctx->renderer, x + center - SDL_strlen(text) * FONT_CHARACTER_SIZE, y, text);
|
||||
SDL_snprintf(text, sizeof(text), "(%.2f,%.2f,%.2f)", ctx->accel_data[0], ctx->accel_data[1], ctx->accel_data[2]);
|
||||
SDL_snprintf(text, sizeof(text), "[%.2f,%.2f,%.2f]m/s%s", ctx->accel_data[0], ctx->accel_data[1], ctx->accel_data[2], SQUARED_UTF8 );
|
||||
SDLTest_DrawString(ctx->renderer, x + center + 2.0f, y, text);
|
||||
|
||||
y += ctx->button_height + 2.0f;
|
||||
}
|
||||
|
||||
if (has_gyro) {
|
||||
SDL_strlcpy(text, "Gyro:", sizeof(text));
|
||||
SDLTest_DrawString(ctx->renderer, x + center - SDL_strlen(text) * FONT_CHARACTER_SIZE, y, text);
|
||||
SDL_snprintf(text, sizeof(text), "(%.2f,%.2f,%.2f)", ctx->gyro_data[0], ctx->gyro_data[1], ctx->gyro_data[2]);
|
||||
SDL_snprintf(text, sizeof(text), "[%.2f,%.2f,%.2f]%s/s", ctx->gyro_data[0] * RAD_TO_DEG, ctx->gyro_data[1] * RAD_TO_DEG, ctx->gyro_data[2] * RAD_TO_DEG, DEGREE_UTF8);
|
||||
SDLTest_DrawString(ctx->renderer, x + center + 2.0f, y, text);
|
||||
|
||||
y += ctx->button_height + 2.0f;
|
||||
|
||||
/* Display the testcontroller tool's evaluation of drift. This is also useful to get an average rate of turn in calibrated turntable tests. */
|
||||
if (ctx->gyro_drift_correction_data[0] != 0.0f && ctx->gyro_drift_correction_data[2] != 0.0f && ctx->gyro_drift_correction_data[2] != 0.0f )
|
||||
{
|
||||
y += ctx->button_height + 2.0f;
|
||||
SDL_strlcpy(text, "Gyro Drift:", sizeof(text));
|
||||
SDLTest_DrawString(ctx->renderer, x + center - SDL_strlen(text) * FONT_CHARACTER_SIZE, y, text);
|
||||
SDL_snprintf(text, sizeof(text), "[%.2f,%.2f,%.2f]%s/s", ctx->gyro_drift_correction_data[0] * RAD_TO_DEG, ctx->gyro_drift_correction_data[1] * RAD_TO_DEG, ctx->gyro_drift_correction_data[2] * RAD_TO_DEG, DEGREE_UTF8);
|
||||
SDLTest_DrawString(ctx->renderer, x + center + 2.0f, y, text);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
SDL_free(mapping);
|
||||
@@ -1325,6 +1668,260 @@ void DestroyGamepadDisplay(GamepadDisplay *ctx)
|
||||
SDL_free(ctx);
|
||||
}
|
||||
|
||||
void RenderSensorTimingInfo(GyroDisplay *ctx, GamepadDisplay *gamepad_display)
|
||||
{
|
||||
/* Sensor timing section */
|
||||
char text[128];
|
||||
const float new_line_height = gamepad_display->button_height + 2.0f;
|
||||
const float text_offset_x = ctx->area.x + ctx->area.w / 4.0f + 40.0f;
|
||||
/* Anchor to bottom left of principle rect. */
|
||||
float text_y_pos = ctx->area.y + ctx->area.h - new_line_height * 2;
|
||||
/*
|
||||
* Display rate of gyro as reported by the HID implementation.
|
||||
* This could be based on a hardware time stamp (PS5), or it could be generated by the HID implementation.
|
||||
* One should expect this to match the estimated rate below, assuming a wired connection.
|
||||
*/
|
||||
|
||||
SDL_strlcpy(text, "HID Sensor Time:", sizeof(text));
|
||||
SDLTest_DrawString(ctx->renderer, text_offset_x - SDL_strlen(text) * FONT_CHARACTER_SIZE, text_y_pos, text);
|
||||
if (ctx->reported_sensor_rate_hz > 0) {
|
||||
/* Convert to micro seconds */
|
||||
const int delta_time_us = (int)1e6 / ctx->reported_sensor_rate_hz;
|
||||
SDL_snprintf(text, sizeof(text), "%d%ss %dhz", delta_time_us, MICRO_UTF8, ctx->reported_sensor_rate_hz);
|
||||
} else {
|
||||
SDL_snprintf(text, sizeof(text), "????%ss ???hz", MICRO_UTF8);
|
||||
}
|
||||
SDLTest_DrawString(ctx->renderer, text_offset_x + 2.0f, text_y_pos, text);
|
||||
|
||||
/*
|
||||
* Display the instrumentation's count of all sensor packets received over time.
|
||||
* This may represent a more accurate polling rate for the IMU
|
||||
* But only when using a wired connection.
|
||||
* It does not necessarily reflect the rate at which the IMU is sampled.
|
||||
*/
|
||||
|
||||
text_y_pos += new_line_height;
|
||||
SDL_strlcpy(text, "Est.Sensor Time:", sizeof(text));
|
||||
SDLTest_DrawString(ctx->renderer, text_offset_x - SDL_strlen(text) * FONT_CHARACTER_SIZE, text_y_pos, text);
|
||||
if (ctx->estimated_sensor_rate_hz > 0) {
|
||||
/* Convert to micro seconds */
|
||||
const int delta_time_us = (int)1e6 / ctx->estimated_sensor_rate_hz;
|
||||
SDL_snprintf(text, sizeof(text), "%d%ss %dhz", delta_time_us, MICRO_UTF8, ctx->estimated_sensor_rate_hz);
|
||||
} else {
|
||||
SDL_snprintf(text, sizeof(text), "????%ss ???hz", MICRO_UTF8);
|
||||
}
|
||||
SDLTest_DrawString(ctx->renderer, text_offset_x + 2.0f, text_y_pos, text);
|
||||
}
|
||||
|
||||
void RenderGyroDriftCalibrationButton(GyroDisplay *ctx, GamepadDisplay *gamepad_display )
|
||||
{
|
||||
char label_text[128];
|
||||
float log_y = ctx->area.y + BUTTON_PADDING;
|
||||
const float new_line_height = gamepad_display->button_height + 2.0f;
|
||||
GamepadButton *start_calibration_button = GetGyroCalibrateButton(ctx);
|
||||
bool bHasCachedDriftSolution = BHasCachedGyroDriftSolution(ctx);
|
||||
|
||||
/* Show the recalibration progress bar. */
|
||||
float recalibrate_button_width = GetGamepadButtonLabelWidth(start_calibration_button) + 2 * BUTTON_PADDING;
|
||||
SDL_FRect recalibrate_button_area;
|
||||
recalibrate_button_area.x = ctx->area.x + ctx->area.w - recalibrate_button_width - BUTTON_PADDING;
|
||||
recalibrate_button_area.y = log_y + FONT_CHARACTER_SIZE * 0.5f - gamepad_display->button_height * 0.5f;
|
||||
recalibrate_button_area.w = GetGamepadButtonLabelWidth(start_calibration_button) + 2.0f * BUTTON_PADDING;
|
||||
recalibrate_button_area.h = gamepad_display->button_height + BUTTON_PADDING * 2.0f;
|
||||
|
||||
if (!bHasCachedDriftSolution) {
|
||||
SDL_snprintf(label_text, sizeof(label_text), "Progress: %3.0f%% ", ctx->drift_calibration_progress_frac * 100.0f);
|
||||
} else {
|
||||
SDL_strlcpy(label_text, "Calibrate Drift", sizeof(label_text));
|
||||
}
|
||||
|
||||
SetGamepadButtonLabel(start_calibration_button, label_text);
|
||||
SetGamepadButtonArea(start_calibration_button, &recalibrate_button_area);
|
||||
RenderGamepadButton(start_calibration_button);
|
||||
|
||||
/* Above button */
|
||||
SDL_strlcpy(label_text, "Gyro Orientation:", sizeof(label_text));
|
||||
SDLTest_DrawString(ctx->renderer, recalibrate_button_area.x, recalibrate_button_area.y - new_line_height, label_text);
|
||||
|
||||
if (!bHasCachedDriftSolution) {
|
||||
|
||||
float flNoiseFraction = SDL_clamp(SDL_sqrtf(ctx->accelerometer_noise_sq) / ACCELEROMETER_NOISE_THRESHOLD, 0.0f, 1.0f);
|
||||
bool bTooMuchNoise = (flNoiseFraction == 1.0f);
|
||||
|
||||
float noise_bar_height = gamepad_display->button_height;
|
||||
SDL_FRect noise_bar_rect;
|
||||
noise_bar_rect.x = recalibrate_button_area.x;
|
||||
noise_bar_rect.y = recalibrate_button_area.y + recalibrate_button_area.h + BUTTON_PADDING;
|
||||
noise_bar_rect.w = recalibrate_button_area.w;
|
||||
noise_bar_rect.h = noise_bar_height;
|
||||
|
||||
/* Adjust the noise bar rectangle based on the accelerometer noise value */
|
||||
|
||||
float noise_bar_fill_width = flNoiseFraction * noise_bar_rect.w; /* Scale the width based on the noise value */
|
||||
SDL_FRect noise_bar_fill_rect;
|
||||
noise_bar_fill_rect.x = noise_bar_rect.x + (noise_bar_rect.w - noise_bar_fill_width) * 0.5f;
|
||||
noise_bar_fill_rect.y = noise_bar_rect.y;
|
||||
noise_bar_fill_rect.w = noise_bar_fill_width;
|
||||
noise_bar_fill_rect.h = noise_bar_height;
|
||||
|
||||
/* Set the color based on the noise value */
|
||||
Uint8 red = (Uint8)(flNoiseFraction * 255.0f);
|
||||
Uint8 green = (Uint8)((1.0f - flNoiseFraction) * 255.0f);
|
||||
SDL_SetRenderDrawColor(ctx->renderer, red, green, 0, 255); /* red when high noise, green when low noise */
|
||||
SDL_RenderFillRect(ctx->renderer, &noise_bar_fill_rect); /* draw the filled rectangle */
|
||||
|
||||
SDL_SetRenderDrawColor(ctx->renderer, 100, 100, 100, 255); /* gray box */
|
||||
SDL_RenderRect(ctx->renderer, &noise_bar_rect); /* draw the outline rectangle */
|
||||
|
||||
/* Explicit warning message if we detect too much movement */
|
||||
if (bTooMuchNoise) {
|
||||
SDL_strlcpy(label_text, "Place GamePad Down!", sizeof(label_text));
|
||||
SDLTest_DrawString(ctx->renderer, recalibrate_button_area.x, noise_bar_rect.y + noise_bar_rect.h + new_line_height, label_text);
|
||||
}
|
||||
|
||||
/* Drift progress bar */
|
||||
/* Demonstrate how far we are through the drift progress, and how it resets when there's "high noise", i.e if flNoiseFraction == 1.0f */
|
||||
SDL_FRect progress_bar_rect;
|
||||
progress_bar_rect.x = recalibrate_button_area.x + BUTTON_PADDING;
|
||||
progress_bar_rect.y = recalibrate_button_area.y + recalibrate_button_area.h * 0.5f + BUTTON_PADDING * 0.5f;
|
||||
progress_bar_rect.w = recalibrate_button_area.w - BUTTON_PADDING * 2.0f;
|
||||
progress_bar_rect.h = BUTTON_PADDING * 0.5f;
|
||||
|
||||
/* Adjust the drift bar rectangle based on the drift calibration progress fraction */
|
||||
float drift_bar_fill_width = bTooMuchNoise ? 1.0f : ctx->drift_calibration_progress_frac * progress_bar_rect.w;
|
||||
SDL_FRect progress_bar_fill;
|
||||
progress_bar_fill.x = progress_bar_rect.x;
|
||||
progress_bar_fill.y = progress_bar_rect.y;
|
||||
progress_bar_fill.w = drift_bar_fill_width;
|
||||
progress_bar_fill.h = progress_bar_rect.h;
|
||||
|
||||
/* Set the color based on the drift calibration progress fraction */
|
||||
SDL_SetRenderDrawColor(ctx->renderer, GYRO_COLOR_GREEN); /* red when too much noise, green when low noise*/
|
||||
|
||||
/* Now draw the bars with the filled, then empty rectangles */
|
||||
SDL_RenderFillRect(ctx->renderer, &progress_bar_fill); /* draw the filled rectangle*/
|
||||
SDL_SetRenderDrawColor(ctx->renderer, 100, 100, 100, 255); /* gray box*/
|
||||
SDL_RenderRect(ctx->renderer, &progress_bar_rect); /* draw the outline rectangle*/
|
||||
|
||||
/* If there is too much movement, we are going to draw two diagonal red lines between the progress rect corners.*/
|
||||
if (bTooMuchNoise) {
|
||||
SDL_SetRenderDrawColor(ctx->renderer, GYRO_COLOR_RED); /* red */
|
||||
SDL_RenderFillRect(ctx->renderer, &progress_bar_fill); /* draw the filled rectangle */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
float RenderEulerReadout(GyroDisplay *ctx, GamepadDisplay *gamepad_display )
|
||||
{
|
||||
/* Get the mater button's width and base our width off that */
|
||||
GamepadButton *master_button = GetGyroCalibrateButton(ctx);
|
||||
SDL_FRect gyro_calibrate_button_rect;
|
||||
GetGamepadButtonArea(master_button, &gyro_calibrate_button_rect);
|
||||
|
||||
char text[128];
|
||||
float log_y = gyro_calibrate_button_rect.y + gyro_calibrate_button_rect.h + BUTTON_PADDING;
|
||||
const float new_line_height = gamepad_display->button_height + 2.0f;
|
||||
float log_gyro_euler_text_x = gyro_calibrate_button_rect.x;
|
||||
|
||||
/* Pitch Readout */
|
||||
SDL_snprintf(text, sizeof(text), "Pitch: %6.2f%s", ctx->euler_displacement_angles[0], DEGREE_UTF8);
|
||||
SDLTest_DrawString(ctx->renderer, log_gyro_euler_text_x + 2.0f, log_y, text);
|
||||
|
||||
/* Yaw Readout */
|
||||
log_y += new_line_height;
|
||||
SDL_snprintf(text, sizeof(text), " Yaw: %6.2f%s", ctx->euler_displacement_angles[1], DEGREE_UTF8);
|
||||
SDLTest_DrawString(ctx->renderer, log_gyro_euler_text_x + 2.0f, log_y, text);
|
||||
|
||||
/* Roll Readout */
|
||||
log_y += new_line_height;
|
||||
SDL_snprintf(text, sizeof(text), " Roll: %6.2f%s", ctx->euler_displacement_angles[2], DEGREE_UTF8);
|
||||
SDLTest_DrawString(ctx->renderer, log_gyro_euler_text_x + 2.0f, log_y, text);
|
||||
|
||||
return log_y + new_line_height; /* Return the next y position for further rendering */
|
||||
}
|
||||
|
||||
/* Draws the 3D cube, circles and accel arrow, positioning itself relative to the calibrate button. */
|
||||
void RenderGyroGizmo(GyroDisplay *ctx, SDL_Gamepad *gamepad, float top)
|
||||
{
|
||||
/* Get the calibrate button's on-screen area: */
|
||||
GamepadButton *btn = GetGyroCalibrateButton(ctx);
|
||||
SDL_FRect btnArea;
|
||||
GetGamepadButtonArea(btn, &btnArea);
|
||||
|
||||
float gizmoSize = btnArea.w;
|
||||
/* Position it centered horizontally above the button with a small gap */
|
||||
SDL_FRect gizmoRect;
|
||||
gizmoRect.x = btnArea.x + (btnArea.w - gizmoSize) * 0.5f;
|
||||
gizmoRect.y = top;
|
||||
gizmoRect.w = gizmoSize;
|
||||
gizmoRect.h = gizmoSize;
|
||||
|
||||
/* Draw the rotated cube */
|
||||
DrawGyroDebugCube(ctx->renderer, &ctx->gyro_quaternion, &gizmoRect);
|
||||
|
||||
/* Overlay the XYZ circles */
|
||||
DrawGyroDebugCircle(ctx->renderer, &ctx->gyro_quaternion, &gizmoRect);
|
||||
|
||||
/* If we have accel, draw that arrow too */
|
||||
if (SDL_GamepadHasSensor(gamepad, SDL_SENSOR_ACCEL)) {
|
||||
float accel[3];
|
||||
SDL_GetGamepadSensorData(gamepad, SDL_SENSOR_ACCEL, accel, SDL_arraysize(accel));
|
||||
DrawAccelerometerDebugArrow(ctx->renderer, &ctx->gyro_quaternion, accel, &gizmoRect);
|
||||
}
|
||||
|
||||
/* Follow the size of the main button, but position it below the gizmo */
|
||||
GamepadButton *reset_button = GetGyroResetButton(ctx);
|
||||
if (reset_button) {
|
||||
SDL_FRect reset_area;
|
||||
GetGamepadButtonArea(reset_button, &reset_area);
|
||||
/* Position the reset button below the gizmo */
|
||||
reset_area.x = btnArea.x;
|
||||
reset_area.y = gizmoRect.y + gizmoRect.h + BUTTON_PADDING * 0.5f;
|
||||
reset_area.w = btnArea.w;
|
||||
reset_area.h = btnArea.h;
|
||||
SetGamepadButtonArea(reset_button, &reset_area);
|
||||
RenderGamepadButton(reset_button);
|
||||
}
|
||||
}
|
||||
|
||||
void RenderGyroDisplay(GyroDisplay *ctx, GamepadDisplay *gamepadElements, SDL_Gamepad *gamepad)
|
||||
{
|
||||
if (!ctx)
|
||||
return;
|
||||
|
||||
bool bHasAccelerometer = SDL_GamepadHasSensor(gamepad, SDL_SENSOR_ACCEL);
|
||||
bool bHasGyroscope = SDL_GamepadHasSensor(gamepad, SDL_SENSOR_GYRO);
|
||||
bool bHasIMU = bHasAccelerometer || bHasGyroscope;
|
||||
if (!bHasIMU)
|
||||
return;
|
||||
|
||||
Uint8 r, g, b, a;
|
||||
SDL_GetRenderDrawColor(ctx->renderer, &r, &g, &b, &a);
|
||||
|
||||
RenderSensorTimingInfo(ctx, gamepadElements);
|
||||
|
||||
RenderGyroDriftCalibrationButton(ctx, gamepadElements);
|
||||
|
||||
bool bHasCachedDriftSolution = BHasCachedGyroDriftSolution(ctx);
|
||||
if (bHasCachedDriftSolution) {
|
||||
float bottom = RenderEulerReadout(ctx, gamepadElements);
|
||||
RenderGyroGizmo(ctx, gamepad, bottom);
|
||||
|
||||
}
|
||||
SDL_SetRenderDrawColor(ctx->renderer, r, g, b, a);
|
||||
}
|
||||
|
||||
void DestroyGyroDisplay(GyroDisplay *ctx)
|
||||
{
|
||||
if (!ctx) {
|
||||
return;
|
||||
}
|
||||
DestroyGamepadButton(ctx->reset_gyro_button);
|
||||
DestroyGamepadButton(ctx->calibrate_gyro_button);
|
||||
SDL_free(ctx);
|
||||
}
|
||||
|
||||
|
||||
struct GamepadTypeDisplay
|
||||
{
|
||||
SDL_Renderer *renderer;
|
||||
@@ -1958,13 +2555,25 @@ GamepadButton *CreateGamepadButton(SDL_Renderer *renderer, const char *label)
|
||||
ctx->background = CreateTexture(renderer, gamepad_button_background_bmp, gamepad_button_background_bmp_len);
|
||||
SDL_GetTextureSize(ctx->background, &ctx->background_width, &ctx->background_height);
|
||||
|
||||
ctx->label = SDL_strdup(label);
|
||||
ctx->label_width = (float)(FONT_CHARACTER_SIZE * SDL_strlen(label));
|
||||
ctx->label_height = (float)FONT_CHARACTER_SIZE;
|
||||
SetGamepadButtonLabel(ctx, label);
|
||||
}
|
||||
return ctx;
|
||||
}
|
||||
|
||||
void SetGamepadButtonLabel(GamepadButton *ctx, const char *label)
|
||||
{
|
||||
if (!ctx) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ctx->label) {
|
||||
SDL_free(ctx->label);
|
||||
}
|
||||
|
||||
ctx->label = SDL_strdup(label);
|
||||
ctx->label_width = (float)(FONT_CHARACTER_SIZE * SDL_strlen(label));
|
||||
ctx->label_height = (float)FONT_CHARACTER_SIZE;
|
||||
}
|
||||
void SetGamepadButtonArea(GamepadButton *ctx, const SDL_FRect *area)
|
||||
{
|
||||
if (!ctx) {
|
||||
@@ -2467,6 +3076,7 @@ static char *JoinMapping(MappingParts *parts)
|
||||
sort_order[i].index = i;
|
||||
}
|
||||
SDL_qsort(sort_order, parts->num_elements, sizeof(*sort_order), SortMapping);
|
||||
MoveSortedEntry("face", sort_order, parts->num_elements, true);
|
||||
MoveSortedEntry("type", sort_order, parts->num_elements, true);
|
||||
MoveSortedEntry("platform", sort_order, parts->num_elements, true);
|
||||
MoveSortedEntry("crc", sort_order, parts->num_elements, true);
|
||||
@@ -2802,6 +3412,8 @@ const char *GetGamepadTypeString(SDL_GamepadType type)
|
||||
return "Joy-Con (R)";
|
||||
case SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR:
|
||||
return "Joy-Con Pair";
|
||||
case SDL_GAMEPAD_TYPE_GAMECUBE:
|
||||
return "GameCube";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -48,7 +48,19 @@ enum
|
||||
#define PRESSED_COLOR 175, 238, 238, SDL_ALPHA_OPAQUE
|
||||
#define PRESSED_TEXTURE_MOD 175, 238, 238
|
||||
#define SELECTED_COLOR 224, 255, 224, SDL_ALPHA_OPAQUE
|
||||
#define GYRO_COLOR_RED 255, 0, 0, SDL_ALPHA_OPAQUE
|
||||
#define GYRO_COLOR_GREEN 0, 255, 0, SDL_ALPHA_OPAQUE
|
||||
#define GYRO_COLOR_BLUE 0, 0, 255, SDL_ALPHA_OPAQUE
|
||||
#define GYRO_COLOR_ORANGE 255, 128, 0, SDL_ALPHA_OPAQUE
|
||||
|
||||
/* Shared layout constants */
|
||||
#define BUTTON_PADDING 12.0f
|
||||
#define MINIMUM_BUTTON_WIDTH 96.0f
|
||||
|
||||
/* Symbol */
|
||||
#define DEGREE_UTF8 "\xC2\xB0"
|
||||
#define SQUARED_UTF8 "\xC2\xB2"
|
||||
#define MICRO_UTF8 "\xC2\xB5"
|
||||
/* Gamepad image display */
|
||||
|
||||
extern GamepadImage *CreateGamepadImage(SDL_Renderer *renderer);
|
||||
@@ -78,6 +90,7 @@ typedef struct GamepadDisplay GamepadDisplay;
|
||||
extern GamepadDisplay *CreateGamepadDisplay(SDL_Renderer *renderer);
|
||||
extern void SetGamepadDisplayDisplayMode(GamepadDisplay *ctx, ControllerDisplayMode display_mode);
|
||||
extern void SetGamepadDisplayArea(GamepadDisplay *ctx, const SDL_FRect *area);
|
||||
extern void SetGamepadDisplayGyroDriftCorrection(GamepadDisplay *ctx, float *gyro_drift_correction);
|
||||
extern int GetGamepadDisplayElementAt(GamepadDisplay *ctx, SDL_Gamepad *gamepad, float x, float y);
|
||||
extern void SetGamepadDisplayHighlight(GamepadDisplay *ctx, int element, bool pressed);
|
||||
extern void SetGamepadDisplaySelected(GamepadDisplay *ctx, int element);
|
||||
@@ -118,6 +131,7 @@ extern void DestroyJoystickDisplay(JoystickDisplay *ctx);
|
||||
typedef struct GamepadButton GamepadButton;
|
||||
|
||||
extern GamepadButton *CreateGamepadButton(SDL_Renderer *renderer, const char *label);
|
||||
extern void SetGamepadButtonLabel(GamepadButton *ctx, const char *label);
|
||||
extern void SetGamepadButtonArea(GamepadButton *ctx, const SDL_FRect *area);
|
||||
extern void GetGamepadButtonArea(GamepadButton *ctx, SDL_FRect *area);
|
||||
extern void SetGamepadButtonHighlight(GamepadButton *ctx, bool highlight, bool pressed);
|
||||
@@ -127,6 +141,22 @@ extern bool GamepadButtonContains(GamepadButton *ctx, float x, float y);
|
||||
extern void RenderGamepadButton(GamepadButton *ctx);
|
||||
extern void DestroyGamepadButton(GamepadButton *ctx);
|
||||
|
||||
/* Gyro element Display */
|
||||
/* If you want to calbirate against a known rotation (i.e. a turn table test) Increase ACCELEROMETER_NOISE_THRESHOLD to about 5, or drift correction will be constantly reset.*/
|
||||
#define ACCELEROMETER_NOISE_THRESHOLD 0.5f
|
||||
typedef struct Quaternion Quaternion;
|
||||
typedef struct GyroDisplay GyroDisplay;
|
||||
|
||||
extern void InitCirclePoints3D();
|
||||
extern GyroDisplay *CreateGyroDisplay(SDL_Renderer *renderer);
|
||||
extern void SetGyroDisplayArea(GyroDisplay *ctx, const SDL_FRect *area);
|
||||
extern bool BHasCachedGyroDriftSolution(GyroDisplay *ctx);
|
||||
extern void SetGamepadDisplayIMUValues(GyroDisplay *ctx, float *gyro_drift_solution, float *euler_displacement_angles, Quaternion *gyro_quaternion, int reported_senor_rate_hz, int estimated_sensor_rate_hz, float drift_calibration_progress_frac, float accelerometer_noise_sq);
|
||||
extern GamepadButton *GetGyroResetButton(GyroDisplay *ctx);
|
||||
extern GamepadButton *GetGyroCalibrateButton(GyroDisplay *ctx);
|
||||
extern void RenderGyroDisplay(GyroDisplay *ctx, GamepadDisplay *gamepadElements, SDL_Gamepad *gamepad);
|
||||
extern void DestroyGyroDisplay(GyroDisplay *ctx);
|
||||
|
||||
/* Working with mappings and bindings */
|
||||
|
||||
/* Return whether a mapping has any bindings */
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 192 KiB |
@@ -0,0 +1,95 @@
|
||||
32,0.259765625,0,-0,0,-0,0,256,0,256
|
||||
33,0.26416015625,0.04259963723256735,-0.74801901743264665,0.22009567526743265,0.063391442155309036,167.5,44.5,174.5,76.5
|
||||
34,0.3984375,0.034401000396196514,-0.74801901743264665,0.36403649960380352,-0.41838351822503961,242.5,175.5,255.5,188.5
|
||||
35,0.64599609375,-0.0068815929576070169,-0.74801901743264665,0.65238940545760693,0.038034865293185421,0.5,111.5,26.5,142.5
|
||||
36,0.57177734375,0.033055325128763823,-0.79873217115689388,0.54018686237123603,0.08874801901743265,142.5,0.5,162.5,35.5
|
||||
37,0.82666015625,0.020303136762083947,-0.77337559429477021,0.80635701948791605,0.038034865293185421,175.5,44.5,206.5,76.5
|
||||
38,0.728515625,0.021001510499207562,-0.77337559429477021,0.75634223950079238,0.038034865293185421,214.5,44.5,243.5,76.5
|
||||
39,0.21923828125,0.033793550663629157,-0.74801901743264665,0.18593301183637084,-0.41838351822503961,89.5,232.5,95.5,245.5
|
||||
40,0.294921875,0.012882577258320127,-0.74801901743264665,0.29180492274167991,0.19017432646592711,62.5,0.5,73.5,37.5
|
||||
41,0.294921875,0.0031169522583201267,-0.74801901743264665,0.28203929774167991,0.19017432646592711,74.5,0.5,85.5,37.5
|
||||
42,0.55078125,0.0079258648227020154,-0.79873217115689388,0.54041397892729792,-0.26624405705229792,234.5,78.5,255.5,99.5
|
||||
43,0.57177734375,0.018668052322702015,-0.62123613312202852,0.55115616642729792,-0.063391442155309036,22.5,232.5,43.5,254.5
|
||||
44,0.2587890625,0.011122520676505546,-0.16481774960380352,0.21397513557349446,0.16481774960380349,118.5,232.5,126.5,245.5
|
||||
45,0.32177734375,0.0089933513272583213,-0.34231378763866882,0.31327227367274169,-0.19017432646592711,242.5,189.5,254.5,195.5
|
||||
46,0.2626953125,0.04259963723256735,-0.13946117274167988,0.22009567526743265,0.063391442155309036,138.5,232.5,145.5,240.5
|
||||
47,0.36669921875,-0.019747146146988907,-0.74801901743264665,0.38595808364698891,0.038034865293185421,95.5,143.5,111.5,174.5
|
||||
48,0.57177734375,0.019400474197702015,-0.77337559429477021,0.55188858830229792,0.038034865293185421,0.5,78.5,21.5,110.5
|
||||
49,0.57177734375,0.055885375396196514,-0.74801901743264665,0.38552087460380352,0.038034865293185421,137.5,143.5,150.5,174.5
|
||||
50,0.57177734375,0.016959067947702015,-0.77337559429477021,0.54944718205229792,0.038034865293185421,22.5,78.5,43.5,110.5
|
||||
51,0.57177734375,0.012564536697702015,-0.77337559429477021,0.54505265080229792,0.038034865293185421,44.5,78.5,65.5,110.5
|
||||
52,0.57177734375,-0.0044912589144215989,-0.74801901743264665,0.57871000891442159,0.038034865293185421,232.5,143.5,255.5,174.5
|
||||
53,0.57177734375,0.035740872003763823,-0.74801901743264665,0.54287240924623603,0.038034865293185421,235.5,111.5,255.5,142.5
|
||||
54,0.57177734375,0.023795005447702015,-0.77337559429477021,0.55628311955229792,0.038034865293185421,66.5,78.5,87.5,110.5
|
||||
55,0.57177734375,0.017203208572702015,-0.74801901743264665,0.54969132267729792,0.038034865293185421,82.5,175.5,103.5,206.5
|
||||
56,0.57177734375,0.018912192947702015,-0.77337559429477021,0.55140030705229792,0.038034865293185421,88.5,78.5,109.5,110.5
|
||||
57,0.57177734375,0.017935630447702015,-0.77337559429477021,0.55042374455229792,0.038034865293185421,110.5,78.5,131.5,110.5
|
||||
58,0.2626953125,0.04259963723256735,-0.59587955625990485,0.22009567526743265,0.063391442155309036,130.5,175.5,137.5,201.5
|
||||
59,0.2626953125,-0.0044854552545562608,-0.59587955625990485,0.22372373650455626,0.16481774960380349,104.5,175.5,113.5,205.5
|
||||
60,0.57177734375,0.018912192947702015,-0.64659270998415219,0.55140030705229792,-0.08874801901743265,0.5,232.5,21.5,254.5
|
||||
61,0.57177734375,0.018912192947702015,-0.51980982567353418,0.55140030705229792,-0.19017432646592711,96.5,232.5,117.5,245.5
|
||||
62,0.57177734375,0.018912192947702015,-0.64659270998415219,0.55140030705229792,-0.08874801901743265,44.5,232.5,65.5,254.5
|
||||
63,0.431640625,-0.018492394884112522,-0.77337559429477021,0.43792598863411253,0.063391442155309036,22.5,44.5,40.5,77.5
|
||||
64,0.896484375,0.030102809899960288,-0.74801901743264665,0.86686984635003961,0.13946117274167988,163.5,0.5,196.5,35.5
|
||||
65,0.63232421875,-0.026639959513668827,-0.74801901743264665,0.65798761576366882,0.038034865293185421,23.5,175.5,50.5,206.5
|
||||
66,0.64599609375,0.065804217016640215,-0.74801901743264665,0.6236489079833597,0.038034865293185421,0.5,175.5,22.5,206.5
|
||||
67,0.6298828125,0.025799202654516594,-0.77337559429477021,0.63435704734548326,0.038034865293185421,132.5,78.5,156.5,110.5
|
||||
68,0.7255859375,0.064146304848454794,-0.74801901743264665,0.69806072640154515,0.038034865293185421,189.5,143.5,214.5,174.5
|
||||
69,0.5556640625,0.06817752699088743,-0.74801901743264665,0.52459591050911247,0.038034865293185421,170.5,143.5,188.5,174.5
|
||||
70,0.51611328125,0.06817752699088743,-0.74801901743264665,0.52459591050911247,0.038034865293185421,151.5,143.5,169.5,174.5
|
||||
71,0.72705078125,0.027053953917392983,-0.77337559429477021,0.68632495233260693,0.038034865293185421,157.5,78.5,183.5,110.5
|
||||
72,0.7373046875,0.063885140154516601,-0.74801901743264665,0.67244298484548326,0.038034865293185421,112.5,143.5,136.5,174.5
|
||||
73,0.279296875,0.063090425663629157,-0.74801901743264665,0.21522988683637084,0.038034865293185421,244.5,44.5,250.5,75.5
|
||||
74,0.2685546875,-0.11647790585380349,-0.74801901743264665,0.21315759335380352,0.21553090332805072,48.5,0.5,61.5,38.5
|
||||
75,0.6123046875,0.063379834835578408,-0.74801901743264665,0.64658110266442159,0.038034865293185421,45.5,143.5,68.5,174.5
|
||||
76,0.52197265625,0.069398230115887444,-0.74801901743264665,0.52581661363411247,0.038034865293185421,26.5,143.5,44.5,174.5
|
||||
77,0.8994140625,0.069358378318145758,-0.74801901743264665,0.83005568418185416,0.038034865293185421,51.5,175.5,81.5,206.5
|
||||
78,0.7529296875,0.059751773598454787,-0.74801901743264665,0.69366619515154515,0.038034865293185421,0.5,143.5,25.5,174.5
|
||||
79,0.77783203125,0.033923939555269372,-0.77337559429477021,0.74390809169473049,0.038034865293185421,184.5,78.5,212.5,110.5
|
||||
80,0.6015625,0.070164700128763829,-0.74801901743264665,0.57729623737123603,0.038034865293185421,191.5,111.5,211.5,142.5
|
||||
81,0.77783203125,0.033923939555269372,-0.77337559429477021,0.74390809169473049,0.21553090332805072,19.5,0.5,47.5,39.5
|
||||
82,0.6171875,0.070198748266640215,-0.74801901743264665,0.6280434392333597,0.038034865293185421,129.5,111.5,151.5,142.5
|
||||
83,0.54833984375,0.022313137628763823,-0.77337559429477021,0.52944467487123603,0.038034865293185421,213.5,78.5,233.5,110.5
|
||||
84,0.55078125,-0.016942430789421599,-0.74801901743264665,0.56625883703942159,0.038034865293185421,79.5,111.5,102.5,142.5
|
||||
85,0.72900390625,0.059734749529516594,-0.74801901743264665,0.66829259422048326,0.038034865293185421,54.5,111.5,78.5,142.5
|
||||
86,0.59619140625,-0.031539796082607013,-0.74801901743264665,0.62773120233260693,0.038034865293185421,27.5,111.5,53.5,142.5
|
||||
87,0.92333984375,-0.020105038505348741,-0.74801901743264665,0.94344488225534862,0.038034865293185421,152.5,111.5,190.5,142.5
|
||||
88,0.57763671875,-0.028382992026545213,-0.74801901743264665,0.60553142952654515,0.038034865293185421,69.5,143.5,94.5,174.5
|
||||
89,0.55908203125,-0.037416195151545213,-0.74801901743264665,0.59649822640154515,0.038034865293185421,103.5,111.5,128.5,142.5
|
||||
90,0.572265625,0.0069663263916402082,-0.74801901743264665,0.5648110173583597,0.038034865293185421,212.5,111.5,234.5,142.5
|
||||
91,0.3271484375,0.052189217883320121,-0.74801901743264665,0.33111156336667991,0.19017432646592711,102.5,0.5,113.5,37.5
|
||||
92,0.36669921875,-0.019258864896988907,-0.74801901743264665,0.38644636489698891,0.038034865293185421,215.5,143.5,231.5,174.5
|
||||
93,0.3271484375,-0.0037189852416798751,-0.74801901743264665,0.27520336024167991,0.19017432646592711,114.5,0.5,125.5,37.5
|
||||
94,0.57177734375,0.0072104670166402082,-0.74801901743264665,0.5650551579833597,-0.24088748019017434,66.5,232.5,88.5,252.5
|
||||
95,0.43798828125,-0.034571627996236129,0.063391442155309036,0.47255990924623614,0.19017432646592711,89.5,246.5,109.5,251.5
|
||||
96,0.27734375,0.012133131314381934,-0.79873217115689388,0.26569889993561807,-0.57052297939778129,127.5,232.5,137.5,241.5
|
||||
97,0.5556640625,0.019122285434825671,-0.57052297939778129,0.50089724581517436,0.038034865293185421,21.5,207.5,40.5,231.5
|
||||
98,0.61181640625,0.054556724197702015,-0.79873217115689388,0.58704483830229792,0.038034865293185421,41.5,44.5,62.5,77.5
|
||||
99,0.47900390625,0.022767370740887478,-0.57052297939778129,0.47918575425911253,0.038034865293185421,168.5,207.5,186.5,231.5
|
||||
100,0.61181640625,0.024527427322702015,-0.79873217115689388,0.55701554142729792,0.038034865293185421,63.5,44.5,84.5,77.5
|
||||
101,0.5615234375,0.028904934503763823,-0.57052297939778129,0.53603647174623603,0.038034865293185421,200.5,175.5,220.5,199.5
|
||||
102,0.33642578125,-0.017288715828050714,-0.79873217115689388,0.41377309082805075,0.038034865293185421,128.5,44.5,145.5,77.5
|
||||
103,0.54296875,-0.022557665164421599,-0.59587955625990485,0.56064360266442159,0.26624405705229792,197.5,0.5,220.5,34.5
|
||||
104,0.61328125,0.055027981378763823,-0.79873217115689388,0.56215951862123603,0.038034865293185421,146.5,44.5,166.5,77.5
|
||||
105,0.25244140625,0.050883394413629157,-0.77337559429477021,0.20302285558637084,0.038034865293185421,207.5,44.5,213.5,76.5
|
||||
106,0.25244140625,-0.091592586172741686,-0.77337559429477021,0.21268633617274166,0.26624405705229792,6.5,0.5,18.5,41.5
|
||||
107,0.525390625,0.047947903253763823,-0.79873217115689388,0.55507944049623603,0.038034865293185421,107.5,44.5,127.5,77.5
|
||||
108,0.25244140625,0.050150972538629157,-0.79873217115689388,0.20229043371137084,0.038034865293185421,244.5,0.5,250.5,33.5
|
||||
109,0.92578125,0.059382660831022144,-0.57052297939778129,0.87079312041897783,0.038034865293185421,60.5,207.5,92.5,231.5
|
||||
110,0.61328125,0.055027981378763823,-0.57052297939778129,0.56215951862123603,0.038034865293185421,0.5,207.5,20.5,231.5
|
||||
111,0.6015625,0.022347185766640208,-0.57052297939778129,0.5801918767333597,0.038034865293185421,145.5,207.5,167.5,231.5
|
||||
112,0.61181640625,0.054556724197702015,-0.57052297939778129,0.58704483830229792,0.26624405705229792,85.5,44.5,106.5,77.5
|
||||
113,0.61181640625,0.024039146072702015,-0.57052297939778129,0.55652726017729792,0.26624405705229792,0.5,44.5,21.5,77.5
|
||||
114,0.40869140625,0.0493276266590729,-0.57052297939778129,0.42967627959092713,0.038034865293185421,138.5,175.5,153.5,199.5
|
||||
115,0.4765625,0.012757605115887478,-0.57052297939778129,0.46917598863411253,0.038034865293185421,41.5,207.5,59.5,231.5
|
||||
116,0.3564453125,-0.0156137795909271,-0.69730586370839942,0.36473487334092713,0.038034865293185421,114.5,175.5,129.5,204.5
|
||||
117,0.61328125,0.049901028253763823,-0.57052297939778129,0.55703256549623603,0.038034865293185421,221.5,175.5,241.5,199.5
|
||||
118,0.49951171875,-0.029166486108359792,-0.57052297939778129,0.5286782048583597,0.038034865293185421,154.5,175.5,176.5,199.5
|
||||
119,0.77490234375,-0.01825405791897786,-0.57052297939778129,0.79315640166897772,0.038034865293185421,93.5,207.5,125.5,231.5
|
||||
120,0.5234375,-0.017203595483359792,-0.57052297939778129,0.5406410954833597,0.038034865293185421,177.5,175.5,199.5,199.5
|
||||
121,0.5009765625,-0.027945782983359792,-0.57052297939778129,0.5298989079833597,0.26624405705229792,221.5,0.5,243.5,33.5
|
||||
122,0.46875,0.0059216676158874784,-0.57052297939778129,0.46234005113411253,0.038034865293185421,126.5,207.5,144.5,231.5
|
||||
123,0.375,-0.0048715920909271002,-0.74801901743264665,0.37547706084092713,0.19017432646592711,86.5,0.5,101.5,37.5
|
||||
124,0.54931640625,0.21077847971969096,-0.79873217115689377,0.33756136403030901,0.29160063391442159,0.5,0.5,5.5,43.5
|
||||
125,0.375,1.122040907289984e-05,-0.74801901743264665,0.38035987334092713,0.19017432646592711,126.5,0.5,141.5,37.5
|
||||
126,0.57177734375,0.018912192947702015,-0.44374009508716328,0.55140030705229792,-0.24088748019017434,234.5,100.5,255.5,108.5
|
||||
|
@@ -718,16 +718,15 @@ static Texture *CreateTexture(const char *fname)
|
||||
if (!tex) {
|
||||
SDL_Log("Out of memory!");
|
||||
} else {
|
||||
int texw, texh;
|
||||
tex->texture = LoadTexture(state->renderers[0], fname, true, &texw, &texh);
|
||||
tex->texture = LoadTexture(state->renderers[0], fname, true);
|
||||
if (!tex->texture) {
|
||||
SDL_Log("Failed to load '%s': %s", fname, SDL_GetError());
|
||||
SDL_free(tex);
|
||||
return NULL;
|
||||
}
|
||||
SDL_SetTextureBlendMode(tex->texture, SDL_BLENDMODE_BLEND);
|
||||
tex->w = (float) texw;
|
||||
tex->h = (float) texh;
|
||||
tex->w = (float)tex->texture->w;
|
||||
tex->h = (float)tex->texture->h;
|
||||
}
|
||||
return tex;
|
||||
}
|
||||
@@ -1061,6 +1060,10 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
|
||||
{
|
||||
int i;
|
||||
|
||||
char version[32]; /* use SDL's version number, since this test program is part of SDL's sources. */
|
||||
SDL_snprintf(version, sizeof (version), "%d.%d.%d", SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_MICRO_VERSION);
|
||||
SDL_SetAppMetadata("SDL testaudio", version, "org.libsdl.testaudio");
|
||||
|
||||
state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO | SDL_INIT_AUDIO);
|
||||
if (!state) {
|
||||
return SDL_APP_FAILURE;
|
||||
|
||||
@@ -69,9 +69,19 @@ static int SDLCALL hints_getHint(void *arg)
|
||||
return TEST_COMPLETED;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
char *name;
|
||||
char *value;
|
||||
char *oldValue;
|
||||
} HintCallbackContext;
|
||||
|
||||
static void SDLCALL hints_testHintChanged(void *userdata, const char *name, const char *oldValue, const char *hint)
|
||||
{
|
||||
*(char **)userdata = hint ? SDL_strdup(hint) : NULL;
|
||||
HintCallbackContext *context = userdata;
|
||||
|
||||
context->name = name ? SDL_strdup(name) : NULL;
|
||||
context->value = hint ? SDL_strdup(hint) : NULL;
|
||||
context->oldValue = oldValue ? SDL_strdup(oldValue) : NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -83,7 +93,7 @@ static int SDLCALL hints_setHint(void *arg)
|
||||
const char *originalValue;
|
||||
char *value;
|
||||
const char *testValue;
|
||||
char *callbackValue;
|
||||
HintCallbackContext callback_data;
|
||||
bool result;
|
||||
int i, j;
|
||||
|
||||
@@ -133,8 +143,10 @@ static int SDLCALL hints_setHint(void *arg)
|
||||
SDLTest_AssertPass("Call to SDL_GetHint() after saving and restoring hint");
|
||||
originalValue = SDL_GetHint(testHint);
|
||||
value = (originalValue == NULL) ? NULL : SDL_strdup(originalValue);
|
||||
SDL_SetHint(testHint, "temp");
|
||||
SDL_SetHint(testHint, value);
|
||||
result = SDL_SetHint(testHint, "temp");
|
||||
SDLTest_AssertCheck(!result, "SDL_SetHint(\"%s\", \"temp\") should return false", testHint);
|
||||
result = SDL_SetHint(testHint, value);
|
||||
SDLTest_AssertCheck(!result, "SDL_SetHint(\"%s\", \"%s\" should return false", testHint, value);
|
||||
SDL_free(value);
|
||||
testValue = SDL_GetHint(testHint);
|
||||
SDLTest_AssertCheck(
|
||||
@@ -143,7 +155,8 @@ static int SDLCALL hints_setHint(void *arg)
|
||||
testValue);
|
||||
|
||||
SDLTest_AssertPass("Call to SDL_SetHintWithPriority(NULL, SDL_HINT_DEFAULT)");
|
||||
SDL_SetHintWithPriority(testHint, NULL, SDL_HINT_DEFAULT);
|
||||
result = SDL_SetHintWithPriority(testHint, NULL, SDL_HINT_DEFAULT);
|
||||
SDLTest_AssertCheck(!result, "SDL_SetHintWithPriority(\"%s\", NULL, SDL_HINT_DEFAULT) should return false", testHint);
|
||||
testValue = SDL_GetHint(testHint);
|
||||
SDLTest_AssertCheck(
|
||||
testValue && SDL_strcmp(testValue, "original") == 0,
|
||||
@@ -151,7 +164,8 @@ static int SDLCALL hints_setHint(void *arg)
|
||||
testValue);
|
||||
|
||||
SDLTest_AssertPass("Call to SDL_SetHintWithPriority(\"temp\", SDL_HINT_OVERRIDE)");
|
||||
SDL_SetHintWithPriority(testHint, "temp", SDL_HINT_OVERRIDE);
|
||||
result = SDL_SetHintWithPriority(testHint, "temp", SDL_HINT_OVERRIDE);
|
||||
SDLTest_AssertCheck(result, "SDL_SetHintWithPriority(\"%s\", \"temp\", SDL_HINT_OVERRIDE) should return true", testHint);
|
||||
testValue = SDL_GetHint(testHint);
|
||||
SDLTest_AssertCheck(
|
||||
testValue && SDL_strcmp(testValue, "temp") == 0,
|
||||
@@ -159,7 +173,8 @@ static int SDLCALL hints_setHint(void *arg)
|
||||
testValue);
|
||||
|
||||
SDLTest_AssertPass("Call to SDL_SetHintWithPriority(NULL, SDL_HINT_OVERRIDE)");
|
||||
SDL_SetHintWithPriority(testHint, NULL, SDL_HINT_OVERRIDE);
|
||||
result = SDL_SetHintWithPriority(testHint, NULL, SDL_HINT_OVERRIDE);
|
||||
SDLTest_AssertCheck(result, "SDL_SetHintWithPriority(\"%s\", NULL, SDL_HINT_OVERRIDE) should return true", testHint);
|
||||
testValue = SDL_GetHint(testHint);
|
||||
SDLTest_AssertCheck(
|
||||
testValue == NULL,
|
||||
@@ -175,50 +190,83 @@ static int SDLCALL hints_setHint(void *arg)
|
||||
testValue);
|
||||
|
||||
/* Make sure callback functionality works past a reset */
|
||||
SDL_zero(callback_data);
|
||||
SDLTest_AssertPass("Call to SDL_AddHintCallback()");
|
||||
callbackValue = NULL;
|
||||
SDL_AddHintCallback(testHint, hints_testHintChanged, &callbackValue);
|
||||
SDL_AddHintCallback(testHint, hints_testHintChanged, &callback_data);
|
||||
SDLTest_AssertCheck(
|
||||
callbackValue && SDL_strcmp(callbackValue, "original") == 0,
|
||||
"callbackValue = %s, expected \"original\"",
|
||||
callbackValue);
|
||||
SDL_free(callbackValue);
|
||||
|
||||
SDLTest_AssertPass("Call to SDL_SetHintWithPriority(\"temp\", SDL_HINT_OVERRIDE), using callback");
|
||||
callbackValue = NULL;
|
||||
SDL_SetHintWithPriority(testHint, "temp", SDL_HINT_OVERRIDE);
|
||||
callback_data.name && SDL_strcmp(callback_data.name, testHint) == 0,
|
||||
"callback_data.name = \"%s\", expected \"%s\"",
|
||||
callback_data.name, testHint);
|
||||
SDLTest_AssertCheck(
|
||||
callbackValue && SDL_strcmp(callbackValue, "temp") == 0,
|
||||
"callbackValue = %s, expected \"temp\"",
|
||||
callbackValue);
|
||||
SDL_free(callbackValue);
|
||||
callback_data.value && SDL_strcmp(callback_data.value, "original") == 0,
|
||||
"callback_data.value = \"%s\", expected \"%s\"",
|
||||
callback_data.value, "original");
|
||||
SDL_free(callback_data.name);
|
||||
SDL_free(callback_data.value);
|
||||
SDL_free(callback_data.oldValue);
|
||||
SDL_zero(callback_data);
|
||||
|
||||
SDLTest_AssertPass("Call to SDL_ResetHint(), using callback");
|
||||
callbackValue = NULL;
|
||||
SDL_ResetHint(testHint);
|
||||
SDLTest_AssertCheck(
|
||||
callbackValue && SDL_strcmp(callbackValue, "original") == 0,
|
||||
callback_data.value && SDL_strcmp(callback_data.value, "original") == 0,
|
||||
"callbackValue = %s, expected \"original\"",
|
||||
callbackValue);
|
||||
SDL_free(callbackValue);
|
||||
callback_data.value);
|
||||
SDL_free(callback_data.name);
|
||||
SDL_free(callback_data.value);
|
||||
SDL_free(callback_data.oldValue);
|
||||
SDL_zero(callback_data);
|
||||
|
||||
SDLTest_AssertPass("Call to SDL_SetHintWithPriority(\"temp\", SDL_HINT_OVERRIDE), using callback after reset");
|
||||
callbackValue = NULL;
|
||||
SDL_SetHintWithPriority(testHint, "temp", SDL_HINT_OVERRIDE);
|
||||
result = SDL_SetHintWithPriority(testHint, "temp", SDL_HINT_OVERRIDE);
|
||||
SDLTest_AssertCheck(result, "SDL_SetHintWithPriority(\"%s\", \"temp\", SDL_HINT_OVERRIDE) should return true", testHint);
|
||||
SDLTest_AssertCheck(
|
||||
callbackValue && SDL_strcmp(callbackValue, "temp") == 0,
|
||||
callback_data.value && SDL_strcmp(callback_data.value, "temp") == 0,
|
||||
"callbackValue = %s, expected \"temp\"",
|
||||
callbackValue);
|
||||
SDL_free(callbackValue);
|
||||
callback_data.value);
|
||||
SDL_free(callback_data.name);
|
||||
SDL_free(callback_data.value);
|
||||
SDL_free(callback_data.oldValue);
|
||||
SDL_zero(callback_data);
|
||||
|
||||
SDLTest_AssertPass("Call to SDL_ResetHint(), after clearing callback");
|
||||
callbackValue = NULL;
|
||||
SDL_RemoveHintCallback(testHint, hints_testHintChanged, &callbackValue);
|
||||
SDL_RemoveHintCallback(testHint, hints_testHintChanged, &callback_data);
|
||||
SDL_ResetHint(testHint);
|
||||
SDLTest_AssertCheck(
|
||||
callbackValue == NULL,
|
||||
!callback_data.value,
|
||||
"callbackValue = %s, expected \"(null)\"",
|
||||
callbackValue);
|
||||
callback_data.value);
|
||||
SDL_free(callback_data.name);
|
||||
SDL_free(callback_data.value);
|
||||
SDL_free(callback_data.oldValue);
|
||||
SDL_zero(callback_data);
|
||||
|
||||
/* Make sure callback functionality work with hint renamed in sdl3 */
|
||||
SDLTest_AssertPass("Call to SDL_AddHintCallback()");
|
||||
SDL_AddHintCallback(SDL_HINT_WINDOW_ALLOW_TOPMOST, hints_testHintChanged, &callback_data);
|
||||
SDLTest_AssertPass("Call to SDL_SetHintWithPriority(\"temp\", SDL_HINT_OVERRIDE), using callback");
|
||||
SDLTest_AssertCheck(callback_data.name && SDL_strcmp(callback_data.name, SDL_HINT_WINDOW_ALLOW_TOPMOST) == 0, "callback was called with name \"%s\" (expected \"%s\")", callback_data.name, SDL_HINT_WINDOW_ALLOW_TOPMOST);
|
||||
SDLTest_AssertCheck(!callback_data.value, "callback was called with null value, was %s", callback_data.value);
|
||||
SDLTest_AssertCheck(!callback_data.oldValue, "callback was called with null oldvalue, was %s", callback_data.oldValue);
|
||||
SDL_free(callback_data.name);
|
||||
SDL_free(callback_data.value);
|
||||
SDL_free(callback_data.oldValue);
|
||||
SDL_zero(callback_data);
|
||||
result = SDL_SetHintWithPriority(SDL_HINT_WINDOW_ALLOW_TOPMOST, "temp", SDL_HINT_OVERRIDE);
|
||||
SDLTest_AssertCheck(result, "SDL_SetHintWithPriority(\"%s\", \"temp\", SDL_HINT_OVERRIDE) should return true", testHint);
|
||||
SDLTest_AssertCheck(
|
||||
callback_data.name && SDL_strcmp(callback_data.name, SDL_HINT_WINDOW_ALLOW_TOPMOST) == 0,
|
||||
"callback_data.name = \"%s\", expected \"%s\"",
|
||||
callback_data.name, SDL_HINT_WINDOW_ALLOW_TOPMOST);
|
||||
SDLTest_AssertCheck(
|
||||
callback_data.value && SDL_strcmp(callback_data.value, "temp") == 0,
|
||||
"callback_data.value = \"%s\", expected \"%s\"",
|
||||
callback_data.value, "temp");
|
||||
SDL_free(callback_data.name);
|
||||
SDL_free(callback_data.value);
|
||||
SDL_free(callback_data.oldValue);
|
||||
SDL_zero(callback_data);
|
||||
SDL_ResetHint(testHint);
|
||||
|
||||
return TEST_COMPLETED;
|
||||
}
|
||||
@@ -226,17 +274,19 @@ static int SDLCALL hints_setHint(void *arg)
|
||||
/* ================= Test References ================== */
|
||||
|
||||
/* Hints test cases */
|
||||
static const SDLTest_TestCaseReference hintsTest1 = {
|
||||
static const SDLTest_TestCaseReference hintsGetHint = {
|
||||
hints_getHint, "hints_getHint", "Call to SDL_GetHint", TEST_ENABLED
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference hintsTest2 = {
|
||||
static const SDLTest_TestCaseReference hintsSetHint = {
|
||||
hints_setHint, "hints_setHint", "Call to SDL_SetHint", TEST_ENABLED
|
||||
};
|
||||
|
||||
/* Sequence of Hints test cases */
|
||||
static const SDLTest_TestCaseReference *hintsTests[] = {
|
||||
&hintsTest1, &hintsTest2, NULL
|
||||
&hintsGetHint,
|
||||
&hintsSetHint,
|
||||
NULL
|
||||
};
|
||||
|
||||
/* Hints test suite (global) */
|
||||
|
||||
@@ -132,6 +132,23 @@ static int SDLCALL TestVirtualJoystick(void *arg)
|
||||
SDL_UpdateJoysticks();
|
||||
SDLTest_AssertCheck(SDL_GetGamepadButton(gamepad, SDL_GAMEPAD_BUTTON_SOUTH) == false, "SDL_GetGamepadButton(SDL_GAMEPAD_BUTTON_SOUTH) == false");
|
||||
|
||||
/* Set an explicit mapping with legacy GameCube style buttons */
|
||||
SDL_SetGamepadMapping(SDL_GetJoystickID(joystick), "ff0013db5669727475616c2043007601,Virtual Nintendo GameCube,a:b0,b:b1,x:b2,y:b3,back:b4,guide:b5,start:b6,leftstick:b7,rightstick:b8,leftshoulder:b9,rightshoulder:b10,dpup:b11,dpdown:b12,dpleft:b13,dpright:b14,misc1:b15,paddle1:b16,paddle2:b17,paddle3:b18,paddle4:b19,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,hint:SDL_GAMECONTROLLER_USE_GAMECUBE_LABELS:=1,");
|
||||
{
|
||||
const char *name = SDL_GetGamepadName(gamepad);
|
||||
SDLTest_AssertCheck(name && SDL_strcmp(name, "Virtual Nintendo GameCube") == 0, "SDL_GetGamepadName() -> \"%s\" (expected \"%s\")", name, "Virtual Nintendo GameCube");
|
||||
}
|
||||
SDLTest_AssertCheck(SDL_GetGamepadButtonLabel(gamepad, SDL_GAMEPAD_BUTTON_EAST) == SDL_GAMEPAD_BUTTON_LABEL_X, "SDL_GetGamepadButtonLabel(SDL_GAMEPAD_BUTTON_EAST) == SDL_GAMEPAD_BUTTON_LABEL_X");
|
||||
|
||||
/* Set the east button and verify that the gamepad responds, mapping "B" to the west button */
|
||||
SDLTest_AssertCheck(SDL_SetJoystickVirtualButton(joystick, SDL_GAMEPAD_BUTTON_EAST, true), "SDL_SetJoystickVirtualButton(SDL_GAMEPAD_BUTTON_EAST, true)");
|
||||
SDL_UpdateJoysticks();
|
||||
SDLTest_AssertCheck(SDL_GetGamepadButton(gamepad, SDL_GAMEPAD_BUTTON_WEST) == true, "SDL_GetGamepadButton(SDL_GAMEPAD_BUTTON_WEST) == true");
|
||||
|
||||
SDLTest_AssertCheck(SDL_SetJoystickVirtualButton(joystick, SDL_GAMEPAD_BUTTON_EAST, false), "SDL_SetJoystickVirtualButton(SDL_GAMEPAD_BUTTON_EAST, false)");
|
||||
SDL_UpdateJoysticks();
|
||||
SDLTest_AssertCheck(SDL_GetGamepadButton(gamepad, SDL_GAMEPAD_BUTTON_WEST) == false, "SDL_GetGamepadButton(SDL_GAMEPAD_BUTTON_WEST) == false");
|
||||
|
||||
/* Set an explicit mapping with legacy Nintendo style buttons */
|
||||
SDL_SetGamepadMapping(SDL_GetJoystickID(joystick), "ff0013db5669727475616c2043007601,Virtual Nintendo Gamepad,a:b1,b:b0,x:b3,y:b2,back:b4,guide:b5,start:b6,leftstick:b7,rightstick:b8,leftshoulder:b9,rightshoulder:b10,dpup:b11,dpdown:b12,dpleft:b13,dpright:b14,misc1:b15,paddle1:b16,paddle2:b17,paddle3:b18,paddle4:b19,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,");
|
||||
{
|
||||
|
||||
@@ -14,6 +14,33 @@
|
||||
/**
|
||||
* Private helper to check SDL_GetRectAndLineIntersectionFloat results
|
||||
*/
|
||||
static bool IsFRectEqual(const SDL_FRect *r1, const SDL_FRect *r2) {
|
||||
static const float MAX_DELTA = 1e-5f;
|
||||
SDL_FRect delta;
|
||||
delta.x = r1->x - r2->x;
|
||||
delta.y = r1->y - r2->y;
|
||||
delta.w = r1->w - r2->w;
|
||||
delta.h = r1->h - r2->h;
|
||||
|
||||
return -MAX_DELTA <= delta.x && delta.x <= MAX_DELTA
|
||||
&& -MAX_DELTA <= delta.y && delta.y <= MAX_DELTA
|
||||
&& -MAX_DELTA <= delta.w && delta.w <= MAX_DELTA
|
||||
&& -MAX_DELTA <= delta.w && delta.h <= MAX_DELTA;
|
||||
}
|
||||
|
||||
/* !
|
||||
* \brief Private helper to check SDL_FPoint equality
|
||||
*/
|
||||
static bool IsFPointEqual(const SDL_FPoint *p1, const SDL_FPoint *p2) {
|
||||
static const float MAX_DELTA = 1e-5f;
|
||||
SDL_FPoint delta;
|
||||
delta.x = p1->x - p2->x;
|
||||
delta.y = p1->y - p2->y;
|
||||
|
||||
return -MAX_DELTA <= delta.x && delta.x <= MAX_DELTA
|
||||
&& -MAX_DELTA <= delta.y && delta.y <= MAX_DELTA;
|
||||
}
|
||||
|
||||
static void validateIntersectRectAndLineFloatResults(
|
||||
bool intersection, bool expectedIntersection,
|
||||
SDL_FRect *rect,
|
||||
@@ -1941,6 +1968,226 @@ static int SDLCALL rect_testFRectEqualsParam(void *arg)
|
||||
return TEST_COMPLETED;
|
||||
}
|
||||
|
||||
/* !
|
||||
* \brief Test SDL_HasRectIntersectionFloat
|
||||
*
|
||||
* \sa
|
||||
* http://wiki.libsdl.org/SDL3/SDL_HasRectIntersectionFloat
|
||||
*/
|
||||
static int SDLCALL rect_testHasIntersectionFloat(void *arg)
|
||||
{
|
||||
const struct {
|
||||
SDL_FRect r1;
|
||||
SDL_FRect r2;
|
||||
bool expected;
|
||||
} cases[] = {
|
||||
{ { 0, 0, 0, 0 }, {0, 0, 0, 0}, true },
|
||||
{ { 0, 0, -200, 200 }, {0, 0, -200, 200}, false },
|
||||
{ { 0, 0, 10, 10 }, {-5, 5, 10, 2}, true },
|
||||
{ { 0, 0, 10, 10 }, {-5, -5, 10, 2}, false },
|
||||
{ { 0, 0, 10, 10 }, {-5, -5, 2, 10}, false },
|
||||
{ { 0, 0, 10, 10 }, {-5, -5, 5, 5}, true },
|
||||
{ { 0, 0, 10, 10 }, {-5, -5, 5.1f, 5.1f}, true },
|
||||
{ { 0, 0, 10, 10 }, {-4.99f, -4.99f, 5, 5}, true },
|
||||
};
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < SDL_arraysize(cases); i++) {
|
||||
bool result;
|
||||
SDLTest_AssertPass("About to call SDL_HasRectIntersectionFloat(&{ %g, %g, %g, %g }, &{ %g, %g, %g, %g })",
|
||||
cases[i].r1.x, cases[i].r1.y, cases[i].r1.w, cases[i].r1.h,
|
||||
cases[i].r2.x, cases[i].r2.y, cases[i].r2.w, cases[i].r2.h
|
||||
);
|
||||
result = SDL_HasRectIntersectionFloat(&cases[i].r1, &cases[i].r2);
|
||||
SDLTest_AssertCheck(result == cases[i].expected, "Got %d, expected %d", result, cases[i].expected);
|
||||
}
|
||||
return TEST_COMPLETED;
|
||||
}
|
||||
|
||||
/* !
|
||||
* \brief Test SDL_GetRectIntersectionFloat
|
||||
*
|
||||
* \sa
|
||||
* http://wiki.libsdl.org/SDL3/SDL_GetRectIntersectionFloat
|
||||
*/
|
||||
static int SDLCALL rect_testGetRectIntersectionFloat(void *arg)
|
||||
{
|
||||
const struct {
|
||||
SDL_FRect r1;
|
||||
SDL_FRect r2;
|
||||
bool result;
|
||||
SDL_FRect intersect;
|
||||
} cases[] = {
|
||||
{ { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, true },
|
||||
{ { 0, 0, -200, 200 }, { 0, 0, -200, 200 }, false },
|
||||
{ { 0, 0, 10, 10 }, { -5, 5, 9.9f, 2 }, true, { 0, 5, 4.9f, 2 } },
|
||||
{ { 0, 0, 10, 10 }, { -5, -5, 10, 2 }, false},
|
||||
{ { 0, 0, 10, 10 }, { -5, -5, 2, 10 }, false},
|
||||
{ { 0, 0, 10, 10 }, { -5, -5, 5, 5 }, true},
|
||||
{ { 0, 0, 10, 10 }, { -5, -5, 5.5f, 6 }, true, { 0, 0, 0.5f, 1 } }
|
||||
};
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < SDL_arraysize(cases); i++) {
|
||||
bool result;
|
||||
SDL_FRect intersect;
|
||||
SDLTest_AssertPass("About to call SDL_GetRectIntersectionFloat(&{ %g, %g, %g, %g }, &{ %g, %g, %g, %g })",
|
||||
cases[i].r1.x, cases[i].r1.y, cases[i].r1.w, cases[i].r1.h,
|
||||
cases[i].r2.x, cases[i].r2.y, cases[i].r2.w, cases[i].r2.h
|
||||
);
|
||||
result = SDL_GetRectIntersectionFloat(&cases[i].r1, &cases[i].r2, &intersect);
|
||||
SDLTest_AssertCheck(result == cases[i].result, "Got %d, expected %d", result, cases[i].result);
|
||||
if (cases[i].result) {
|
||||
SDLTest_AssertCheck(IsFRectEqual(&intersect, &cases[i].intersect),
|
||||
"Got { %g, %g, %g, %g }, expected { %g, %g, %g, %g }",
|
||||
intersect.x, intersect.y, intersect.w, intersect.h,
|
||||
cases[i].intersect.x, cases[i].intersect.y, cases[i].intersect.w, cases[i].intersect.h);
|
||||
}
|
||||
}
|
||||
return TEST_COMPLETED;
|
||||
}
|
||||
|
||||
/* !
|
||||
* \brief Test SDL_GetRectUnionFloat
|
||||
*
|
||||
* \sa
|
||||
* http://wiki.libsdl.org/SDL3/SDL_GetRectUnionFloat
|
||||
*/
|
||||
static int SDLCALL rect_testGetRectUntionFloat(void *arg)
|
||||
{
|
||||
const struct {
|
||||
SDL_FRect r1;
|
||||
SDL_FRect r2;
|
||||
SDL_FRect expected;
|
||||
} cases[] = {
|
||||
{ { 0, 0, 10, 10 }, { 19.9f, 20, 10, 10 }, { 0, 0, 29.9f, 30 } },
|
||||
{ { 0, 0, 0, 0 }, { 20, 20.1f, 10.1f, 10 }, { 0, 0.f, 30.1f, 30.1f } },
|
||||
{ { -200, -4.5f, 450, 33 }, { 20, 20, 10, 10 }, { -200, -4.5f, 450, 34.5f } },
|
||||
{ { 0, 0, 15, 16.5f }, { 20, 20, 0, 0 }, { 0, 0, 20.f, 20.f } }
|
||||
};
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < SDL_arraysize(cases); i++) {
|
||||
SDL_FRect result;
|
||||
SDLTest_AssertPass("About to call SDL_GetRectUnionFloat(&{ %g, %g, %g, %g }, &{ %g, %g, %g, %g })",
|
||||
cases[i].r1.x, cases[i].r1.y, cases[i].r1.w, cases[i].r1.h,
|
||||
cases[i].r2.x, cases[i].r2.y, cases[i].r2.w, cases[i].r2.h
|
||||
);
|
||||
SDL_GetRectUnionFloat(&cases[i].r1, &cases[i].r2, &result);
|
||||
SDLTest_AssertCheck(IsFRectEqual(&result, &cases[i].expected),
|
||||
"Got { %g, %g, %g, %g }, expected { %g, %g, %g, %g }",
|
||||
result.x, result.y, result.w, result.h,
|
||||
cases[i].expected.x, cases[i].expected.y, cases[i].expected.w, cases[i].expected.h);
|
||||
}
|
||||
return TEST_COMPLETED;
|
||||
}
|
||||
|
||||
/* !
|
||||
* \brief Test SDL_EncloseFPointsUnionFRect
|
||||
*
|
||||
* \sa
|
||||
* http://wiki.libsdl.org/SDL3/SDL_GetRectEnclosingPointsFloat
|
||||
*/
|
||||
static int SDLCALL rect_testGetRectEnclosingPointsFloat(void *arg)
|
||||
{
|
||||
const struct {
|
||||
bool with_clip;
|
||||
SDL_FRect clip;
|
||||
bool result;
|
||||
SDL_FRect enclosing;
|
||||
} cases[] = {
|
||||
{ true, { 0, 0, 10, 10 }, true, { 0.5f, 0.1f, 5, 7 }},
|
||||
{ true, { 1.2f, 1, 10, 10 }, true, { 1.5f, 1.1f, 4, 6 }},
|
||||
{ true, { -10, -10, 3, 3 }, false },
|
||||
{ false, { 0 }, true, { 0.5f, 0.1f, 5, 7 }}
|
||||
};
|
||||
const SDL_FPoint points[] = {
|
||||
{ 0.5f, 0.1f },
|
||||
{ 5.5f, 7.1f },
|
||||
{ 1.5f, 1.1f }
|
||||
};
|
||||
char points_str[256];
|
||||
size_t i;
|
||||
|
||||
SDL_strlcpy(points_str, "{", sizeof(points_str));
|
||||
for (i = 0; i < SDL_arraysize(points); i++) {
|
||||
char point_str[32];
|
||||
SDL_snprintf(point_str, sizeof(point_str), "{ %g, %g }, ", points[i].x, points[i].y);
|
||||
SDL_strlcat(points_str, point_str, sizeof(points_str));
|
||||
}
|
||||
SDL_strlcat(points_str, "}", sizeof(points_str));
|
||||
for (i = 0; i < SDL_arraysize(cases); i++) {
|
||||
char clip_str[64];
|
||||
bool result;
|
||||
SDL_FRect enclosing;
|
||||
const SDL_FRect* clip_ptr = NULL;
|
||||
if (cases[i].with_clip) {
|
||||
SDL_snprintf(clip_str, sizeof(clip_str), "&{ %g, %g, %g, %g }",
|
||||
cases[i].clip.x, cases[i].clip.y, cases[i].clip.w, cases[i].clip.h);
|
||||
clip_ptr = &cases[i].clip;
|
||||
} else {
|
||||
SDL_strlcpy(clip_str, "NULL", sizeof(clip_str));
|
||||
}
|
||||
SDLTest_AssertPass("About to call SDL_GetRectEnclosingPointsFloat(&%s, %d, %s)", points_str, (int)SDL_arraysize(points), clip_str);
|
||||
result = SDL_GetRectEnclosingPointsFloat(points, SDL_arraysize(points), clip_ptr, &enclosing);
|
||||
SDLTest_AssertCheck(result == cases[i].result, "Got %d, expected %d", result, cases[i].result);
|
||||
if (cases[i].result) {
|
||||
SDLTest_AssertCheck(IsFRectEqual(&enclosing, &cases[i].enclosing),
|
||||
"Got { %g, %g, %g, %g }, expected { %g, %g, %g, %g }",
|
||||
enclosing.x, enclosing.y, enclosing.w, enclosing.h,
|
||||
cases[i].enclosing.x, cases[i].enclosing.y, cases[i].enclosing.w, cases[i].enclosing.h);
|
||||
}
|
||||
}
|
||||
return TEST_COMPLETED;
|
||||
}
|
||||
|
||||
/* !
|
||||
* \brief Test SDL_GetRectAndLineIntersectionFloat
|
||||
*
|
||||
* \sa
|
||||
* http://wiki.libsdl.org/SDL3/SDL_GetRectAndLineIntersectionFloat
|
||||
*/
|
||||
static int SDLCALL rect_testGetRectAndLineIntersectionFloat(void *arg)
|
||||
{
|
||||
const struct {
|
||||
SDL_FRect rect;
|
||||
SDL_FPoint p1;
|
||||
SDL_FPoint p2;
|
||||
bool result;
|
||||
SDL_FPoint expected1;
|
||||
SDL_FPoint expected2;
|
||||
} cases[] = {
|
||||
{ { 0, 0, 0, 0 }, { -4.8f, -4.8f }, { 5.2f, 5.2f}, true, { 0, 0 }, { 0, 0 } },
|
||||
{ { 0, 0, 2, 2 }, { -1, -1 }, { 3.5f, 3.5f}, true, { 0, 0 }, { 2, 2 } },
|
||||
{ { -4, -4, 14, 14 }, { 8, 22 }, { 8, 33}, false }
|
||||
|
||||
};
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < SDL_arraysize(cases); i++) {
|
||||
bool result;
|
||||
SDL_FPoint p1 = cases[i].p1;
|
||||
SDL_FPoint p2 = cases[i].p2;
|
||||
|
||||
SDLTest_AssertPass("About to call SDL_GetRectAndLineIntersectionFloat(&{%g, %g, %g, %g}, &%g, &%g, &%g, &%g)",
|
||||
cases[i].rect.x, cases[i].rect.y, cases[i].rect.w, cases[i].rect.h,
|
||||
p1.x, p1.y, p2.x, p2.y);
|
||||
result = SDL_GetRectAndLineIntersectionFloat(&cases[i].rect, &p1.x, &p1.y, &p2.x, &p2.y);
|
||||
SDLTest_AssertCheck(result == cases[i].result, "Got %d, expected %d", result, cases[i].result);
|
||||
if (cases[i].result) {
|
||||
SDLTest_AssertCheck(IsFPointEqual(&p1, &cases[i].expected1),
|
||||
"Got p1={ %g, %g }, expected p1={ %g, %g }",
|
||||
p1.x, p1.y,
|
||||
cases[i].expected1.x, cases[i].expected1.y);
|
||||
SDLTest_AssertCheck(IsFPointEqual(&p2, &cases[i].expected2),
|
||||
"Got p2={ %g, %g }, expected p2={ %g, %g }",
|
||||
p2.x, p2.y,
|
||||
cases[i].expected2.x, cases[i].expected2.y);
|
||||
}
|
||||
}
|
||||
return TEST_COMPLETED;
|
||||
}
|
||||
|
||||
/* ================= Test References ================== */
|
||||
|
||||
/* Rect test cases */
|
||||
@@ -2097,6 +2344,26 @@ static const SDLTest_TestCaseReference rectTestFRectEqualsParam = {
|
||||
rect_testFRectEqualsParam, "rect_testFRectEqualsParam", "Negative tests against SDL_RectsEqualFloat with invalid parameters", TEST_ENABLED
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference rectTestHasIntersectionFloat = {
|
||||
rect_testHasIntersectionFloat, "rect_testHasIntersectionFloat", "Tests SDL_HasRectIntersectionFloat", TEST_ENABLED
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference rectTestGetRectIntersectionFloat = {
|
||||
rect_testGetRectIntersectionFloat, "rect_testGetRectIntersectionFloat", "Tests SDL_GetRectIntersectionFloat", TEST_ENABLED
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference rectTestGetRectUntionFloat = {
|
||||
rect_testGetRectUntionFloat, "rect_testGetRectUntionFloat", "Tests SDL_GetRectUnionFloat", TEST_ENABLED
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference rectTestGetRectEnclosingPointsFloat = {
|
||||
rect_testGetRectEnclosingPointsFloat, "rect_testGetRectEnclosingPointsFloat", "Tests SDL_GetRectEnclosingPointsFloat", TEST_ENABLED
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference rectTestGetRectAndLineIntersectionFloat = {
|
||||
rect_testGetRectAndLineIntersectionFloat, "rect_testGetRectAndLineIntersectionFloat", "Tests SDL_GetRectAndLineIntersectionFloat", TEST_ENABLED
|
||||
};
|
||||
|
||||
/**
|
||||
* Sequence of Rect test cases; functions that handle simple rectangles including overlaps and merges.
|
||||
*/
|
||||
@@ -2136,6 +2403,11 @@ static const SDLTest_TestCaseReference *rectTests[] = {
|
||||
&rectTestRectEqualsParam,
|
||||
&rectTestFRectEquals,
|
||||
&rectTestFRectEqualsParam,
|
||||
&rectTestHasIntersectionFloat,
|
||||
&rectTestGetRectIntersectionFloat,
|
||||
&rectTestGetRectUntionFloat,
|
||||
&rectTestGetRectEnclosingPointsFloat,
|
||||
&rectTestGetRectAndLineIntersectionFloat,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
@@ -616,6 +616,189 @@ static int SDLCALL render_testBlit9Grid(void *arg)
|
||||
return TEST_COMPLETED;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests tiled 9-grid blitting.
|
||||
*/
|
||||
static int SDLCALL render_testBlit9GridTiled(void *arg)
|
||||
{
|
||||
SDL_Surface *referenceSurface = NULL;
|
||||
SDL_Surface *source = NULL;
|
||||
SDL_Texture *texture;
|
||||
int x, y;
|
||||
SDL_FRect rect;
|
||||
int ret = 0;
|
||||
|
||||
/* Create source surface */
|
||||
source = SDL_CreateSurface(3, 3, SDL_PIXELFORMAT_RGBA32);
|
||||
SDLTest_AssertCheck(source != NULL, "Verify source surface is not NULL");
|
||||
for (y = 0; y < 3; ++y) {
|
||||
for (x = 0; x < 3; ++x) {
|
||||
SDL_WriteSurfacePixel(source, x, y, (Uint8)((1 + x) * COLOR_SEPARATION), (Uint8)((1 + y) * COLOR_SEPARATION), 0, 255);
|
||||
}
|
||||
}
|
||||
texture = SDL_CreateTextureFromSurface(renderer, source);
|
||||
SDLTest_AssertCheck(texture != NULL, "Verify source texture is not NULL");
|
||||
ret = SDL_SetTextureScaleMode(texture, SDL_SCALEMODE_NEAREST);
|
||||
SDLTest_AssertCheck(ret == true, "Validate results from call to SDL_SetTextureScaleMode, expected: true, got: %i", ret);
|
||||
|
||||
/* Tiled 9-grid blit - 1.0 scale */
|
||||
{
|
||||
SDLTest_Log("tiled 9-grid blit - 1.0 scale");
|
||||
/* Create reference surface */
|
||||
SDL_DestroySurface(referenceSurface);
|
||||
referenceSurface = SDL_CreateSurface(TESTRENDER_SCREEN_W, TESTRENDER_SCREEN_H, SDL_PIXELFORMAT_RGBA32);
|
||||
SDLTest_AssertCheck(referenceSurface != NULL, "Verify reference surface is not NULL");
|
||||
Fill9GridReferenceSurface(referenceSurface, 1, 1, 1, 1);
|
||||
|
||||
/* Clear surface. */
|
||||
clearScreen();
|
||||
|
||||
/* Tiled blit. */
|
||||
rect.x = 0.0f;
|
||||
rect.y = 0.0f;
|
||||
rect.w = (float)TESTRENDER_SCREEN_W;
|
||||
rect.h = (float)TESTRENDER_SCREEN_H;
|
||||
ret = SDL_RenderTexture9GridTiled(renderer, texture, NULL, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, &rect, 1.0f);
|
||||
SDLTest_AssertCheck(ret == true, "Validate results from call to SDL_RenderTexture9GridTiled, expected: true, got: %i", ret);
|
||||
|
||||
/* See if it's the same */
|
||||
compare(referenceSurface, ALLOWABLE_ERROR_OPAQUE);
|
||||
|
||||
/* Make current */
|
||||
SDL_RenderPresent(renderer);
|
||||
}
|
||||
|
||||
/* Tiled 9-grid blit - 2.0 scale */
|
||||
{
|
||||
SDLTest_Log("tiled 9-grid blit - 2.0 scale");
|
||||
/* Create reference surface */
|
||||
SDL_DestroySurface(referenceSurface);
|
||||
referenceSurface = SDL_CreateSurface(TESTRENDER_SCREEN_W, TESTRENDER_SCREEN_H, SDL_PIXELFORMAT_RGBA32);
|
||||
SDLTest_AssertCheck(referenceSurface != NULL, "Verify reference surface is not NULL");
|
||||
Fill9GridReferenceSurface(referenceSurface, 2, 2, 2, 2);
|
||||
|
||||
/* Clear surface. */
|
||||
clearScreen();
|
||||
|
||||
/* Tiled blit. */
|
||||
rect.x = 0.0f;
|
||||
rect.y = 0.0f;
|
||||
rect.w = (float)TESTRENDER_SCREEN_W;
|
||||
rect.h = (float)TESTRENDER_SCREEN_H;
|
||||
ret = SDL_RenderTexture9GridTiled(renderer, texture, NULL, 1.0f, 1.0f, 1.0f, 1.0f, 2.0f, &rect, 2.0f);
|
||||
SDLTest_AssertCheck(ret == true, "Validate results from call to SDL_RenderTexture9GridTiled, expected: true, got: %i", ret);
|
||||
|
||||
/* See if it's the same */
|
||||
compare(referenceSurface, ALLOWABLE_ERROR_OPAQUE);
|
||||
|
||||
/* Make current */
|
||||
SDL_RenderPresent(renderer);
|
||||
}
|
||||
|
||||
/* Clean up. */
|
||||
SDL_DestroySurface(source);
|
||||
SDL_DestroyTexture(texture);
|
||||
|
||||
/* Create complex source surface */
|
||||
source = SDL_CreateSurface(5, 5, SDL_PIXELFORMAT_RGBA32);
|
||||
SDLTest_AssertCheck(source != NULL, "Verify source surface is not NULL");
|
||||
SDL_WriteSurfacePixel(source, 0, 0, (Uint8)((1) * COLOR_SEPARATION), (Uint8)((1) * COLOR_SEPARATION), 0, 255);
|
||||
SDL_WriteSurfacePixel(source, 1, 0, (Uint8)((2) * COLOR_SEPARATION), (Uint8)((1) * COLOR_SEPARATION), 0, 255);
|
||||
SDL_WriteSurfacePixel(source, 2, 0, (Uint8)((2) * COLOR_SEPARATION), (Uint8)((1) * COLOR_SEPARATION), 0, 255);
|
||||
SDL_WriteSurfacePixel(source, 3, 0, (Uint8)((3) * COLOR_SEPARATION), (Uint8)((1) * COLOR_SEPARATION), 0, 255);
|
||||
SDL_WriteSurfacePixel(source, 4, 0, (Uint8)((3) * COLOR_SEPARATION), (Uint8)((1) * COLOR_SEPARATION), 0, 255);
|
||||
|
||||
SDL_WriteSurfacePixel(source, 0, 1, (Uint8)((1) * COLOR_SEPARATION), (Uint8)((2) * COLOR_SEPARATION), 0, 255);
|
||||
SDL_WriteSurfacePixel(source, 1, 1, (Uint8)((2) * COLOR_SEPARATION), (Uint8)((2) * COLOR_SEPARATION), 0, 255);
|
||||
SDL_WriteSurfacePixel(source, 2, 1, (Uint8)((2) * COLOR_SEPARATION), (Uint8)((2) * COLOR_SEPARATION), 0, 255);
|
||||
SDL_WriteSurfacePixel(source, 3, 1, (Uint8)((3) * COLOR_SEPARATION), (Uint8)((2) * COLOR_SEPARATION), 0, 255);
|
||||
SDL_WriteSurfacePixel(source, 4, 1, (Uint8)((3) * COLOR_SEPARATION), (Uint8)((2) * COLOR_SEPARATION), 0, 255);
|
||||
|
||||
SDL_WriteSurfacePixel(source, 0, 2, (Uint8)((1) * COLOR_SEPARATION), (Uint8)((2) * COLOR_SEPARATION), 0, 255);
|
||||
SDL_WriteSurfacePixel(source, 1, 2, (Uint8)((2) * COLOR_SEPARATION), (Uint8)((2) * COLOR_SEPARATION), 0, 255);
|
||||
SDL_WriteSurfacePixel(source, 2, 2, (Uint8)((2) * COLOR_SEPARATION), (Uint8)((2) * COLOR_SEPARATION), 0, 255);
|
||||
SDL_WriteSurfacePixel(source, 3, 2, (Uint8)((3) * COLOR_SEPARATION), (Uint8)((2) * COLOR_SEPARATION), 0, 255);
|
||||
SDL_WriteSurfacePixel(source, 4, 2, (Uint8)((3) * COLOR_SEPARATION), (Uint8)((2) * COLOR_SEPARATION), 0, 255);
|
||||
|
||||
SDL_WriteSurfacePixel(source, 0, 3, (Uint8)((1) * COLOR_SEPARATION), (Uint8)((3) * COLOR_SEPARATION), 0, 255);
|
||||
SDL_WriteSurfacePixel(source, 1, 3, (Uint8)((2) * COLOR_SEPARATION), (Uint8)((3) * COLOR_SEPARATION), 0, 255);
|
||||
SDL_WriteSurfacePixel(source, 2, 3, (Uint8)((2) * COLOR_SEPARATION), (Uint8)((3) * COLOR_SEPARATION), 0, 255);
|
||||
SDL_WriteSurfacePixel(source, 3, 3, (Uint8)((3) * COLOR_SEPARATION), (Uint8)((3) * COLOR_SEPARATION), 0, 255);
|
||||
SDL_WriteSurfacePixel(source, 4, 3, (Uint8)((3) * COLOR_SEPARATION), (Uint8)((3) * COLOR_SEPARATION), 0, 255);
|
||||
|
||||
SDL_WriteSurfacePixel(source, 0, 4, (Uint8)((1) * COLOR_SEPARATION), (Uint8)((3) * COLOR_SEPARATION), 0, 255);
|
||||
SDL_WriteSurfacePixel(source, 1, 4, (Uint8)((2) * COLOR_SEPARATION), (Uint8)((3) * COLOR_SEPARATION), 0, 255);
|
||||
SDL_WriteSurfacePixel(source, 2, 4, (Uint8)((2) * COLOR_SEPARATION), (Uint8)((3) * COLOR_SEPARATION), 0, 255);
|
||||
SDL_WriteSurfacePixel(source, 3, 4, (Uint8)((3) * COLOR_SEPARATION), (Uint8)((3) * COLOR_SEPARATION), 0, 255);
|
||||
SDL_WriteSurfacePixel(source, 4, 4, (Uint8)((3) * COLOR_SEPARATION), (Uint8)((3) * COLOR_SEPARATION), 0, 255);
|
||||
|
||||
texture = SDL_CreateTextureFromSurface(renderer, source);
|
||||
SDLTest_AssertCheck(texture != NULL, "Verify source texture is not NULL");
|
||||
ret = SDL_SetTextureScaleMode(texture, SDL_SCALEMODE_NEAREST);
|
||||
SDLTest_AssertCheck(ret == true, "Validate results from call to SDL_SetTextureScaleMode, expected: true, got: %i", ret);
|
||||
|
||||
/* complex tiled 9-grid blit - 1.0 scale */
|
||||
{
|
||||
SDLTest_Log("complex tiled 9-grid blit - 1.0 scale");
|
||||
/* Create reference surface */
|
||||
SDL_DestroySurface(referenceSurface);
|
||||
referenceSurface = SDL_CreateSurface(TESTRENDER_SCREEN_W, TESTRENDER_SCREEN_H, SDL_PIXELFORMAT_RGBA32);
|
||||
SDLTest_AssertCheck(referenceSurface != NULL, "Verify reference surface is not NULL");
|
||||
Fill9GridReferenceSurface(referenceSurface, 1, 2, 1, 2);
|
||||
|
||||
/* Clear surface. */
|
||||
clearScreen();
|
||||
|
||||
/* Tiled blit. */
|
||||
rect.x = 0.0f;
|
||||
rect.y = 0.0f;
|
||||
rect.w = (float)TESTRENDER_SCREEN_W;
|
||||
rect.h = (float)TESTRENDER_SCREEN_H;
|
||||
ret = SDL_RenderTexture9GridTiled(renderer, texture, NULL, 1.0f, 2.0f, 1.0f, 2.0f, 1.0f, &rect, 1.0f);
|
||||
SDLTest_AssertCheck(ret == true, "Validate results from call to SDL_RenderTexture9GridTiled, expected: true, got: %i", ret);
|
||||
|
||||
/* See if it's the same */
|
||||
compare(referenceSurface, ALLOWABLE_ERROR_OPAQUE);
|
||||
|
||||
/* Make current */
|
||||
SDL_RenderPresent(renderer);
|
||||
}
|
||||
|
||||
/* complex tiled 9-grid blit - 2.0 scale */
|
||||
{
|
||||
SDLTest_Log("complex tiled 9-grid blit - 2.0 scale");
|
||||
/* Create reference surface */
|
||||
SDL_DestroySurface(referenceSurface);
|
||||
referenceSurface = SDL_CreateSurface(TESTRENDER_SCREEN_W, TESTRENDER_SCREEN_H, SDL_PIXELFORMAT_RGBA32);
|
||||
SDLTest_AssertCheck(referenceSurface != NULL, "Verify reference surface is not NULL");
|
||||
Fill9GridReferenceSurface(referenceSurface, 2, 4, 2, 4);
|
||||
|
||||
/* Clear surface. */
|
||||
clearScreen();
|
||||
|
||||
/* Tiled blit. */
|
||||
rect.x = 0.0f;
|
||||
rect.y = 0.0f;
|
||||
rect.w = (float)TESTRENDER_SCREEN_W;
|
||||
rect.h = (float)TESTRENDER_SCREEN_H;
|
||||
ret = SDL_RenderTexture9GridTiled(renderer, texture, NULL, 1.0f, 2.0f, 1.0f, 2.0f, 2.0f, &rect, 2.0f);
|
||||
SDLTest_AssertCheck(ret == true, "Validate results from call to SDL_RenderTexture9GridTiled, expected: true, got: %i", ret);
|
||||
|
||||
/* See if it's the same */
|
||||
compare(referenceSurface, ALLOWABLE_ERROR_OPAQUE);
|
||||
|
||||
/* Make current */
|
||||
SDL_RenderPresent(renderer);
|
||||
}
|
||||
|
||||
/* Clean up. */
|
||||
SDL_DestroySurface(referenceSurface);
|
||||
SDL_DestroySurface(source);
|
||||
SDL_DestroyTexture(texture);
|
||||
|
||||
return TEST_COMPLETED;
|
||||
}
|
||||
|
||||
/**
|
||||
* Blits doing color tests.
|
||||
*
|
||||
@@ -1017,6 +1200,129 @@ static int SDLCALL render_testViewport(void *arg)
|
||||
return TEST_COMPLETED;
|
||||
}
|
||||
|
||||
static int SDLCALL render_testRGBSurfaceNoAlpha(void* arg)
|
||||
{
|
||||
SDL_Surface *surface;
|
||||
SDL_Renderer *software_renderer;
|
||||
SDL_Surface *surface2;
|
||||
SDL_Texture *texture2;
|
||||
bool result;
|
||||
SDL_FRect dest_rect;
|
||||
SDL_FPoint point;
|
||||
const SDL_PixelFormatDetails *format_details;
|
||||
Uint8 r, g, b, a;
|
||||
|
||||
SDLTest_AssertPass("About to call SDL_CreateSurface(128, 128, SDL_PIXELFORMAT_RGBX32)");
|
||||
surface = SDL_CreateSurface(128, 128, SDL_PIXELFORMAT_RGBX32);
|
||||
SDLTest_AssertCheck(surface != NULL, "Returned surface must be not NULL");
|
||||
if (surface == NULL) {
|
||||
return TEST_ABORTED;
|
||||
}
|
||||
|
||||
SDLTest_AssertPass("About to call SDL_GetPixelFormatDetails(surface->format)");
|
||||
format_details = SDL_GetPixelFormatDetails(surface->format);
|
||||
SDLTest_AssertCheck(format_details != NULL, "Result must be non-NULL, is %p", format_details);
|
||||
if (format_details == NULL) {
|
||||
SDL_DestroySurface(surface);
|
||||
return TEST_ABORTED;
|
||||
}
|
||||
|
||||
SDLTest_AssertCheck(format_details->bits_per_pixel == 32, "format_details->bits_per_pixel is %d, should be %d", format_details->bits_per_pixel, 32);
|
||||
SDLTest_AssertCheck(format_details->bytes_per_pixel == 4, "format_details->bytes_per_pixel is %d, should be %d", format_details->bytes_per_pixel, 4);
|
||||
|
||||
SDLTest_AssertPass("About to call SDL_CreateSoftwareRenderer(surface)");
|
||||
software_renderer = SDL_CreateSoftwareRenderer(surface);
|
||||
SDLTest_AssertCheck(software_renderer != NULL, "Returned renderer must be not NULL");
|
||||
if (software_renderer == NULL) {
|
||||
SDL_DestroySurface(surface);
|
||||
return TEST_ABORTED;
|
||||
}
|
||||
|
||||
SDLTest_AssertPass("About to call SDL_CreateSurface(16, 16, SDL_PIXELFORMAT_RGBX32)");
|
||||
surface2 = SDL_CreateSurface(16, 16, SDL_PIXELFORMAT_RGBX32);
|
||||
SDLTest_AssertCheck(surface2 != NULL, "Returned surface must be not NULL");
|
||||
if (surface2 == NULL) {
|
||||
SDL_DestroySurface(surface);
|
||||
SDL_DestroyRenderer(software_renderer);
|
||||
return TEST_ABORTED;
|
||||
}
|
||||
|
||||
SDLTest_AssertPass("About to call SDL_FillRect(surface2, NULL, 0)");
|
||||
result = SDL_FillSurfaceRect(surface2, NULL, SDL_MapRGB(SDL_GetPixelFormatDetails(surface2->format), NULL, 0, 0, 0));
|
||||
SDLTest_AssertCheck(result == true, "Result is %d, should be %d", result, true);
|
||||
|
||||
SDLTest_AssertPass("About to call SDL_CreateTextureFromSurface(software_renderer, surface2)");
|
||||
texture2 = SDL_CreateTextureFromSurface(software_renderer, surface2);
|
||||
SDLTest_AssertCheck(texture2 != NULL, "Returned texture is not NULL");
|
||||
|
||||
SDLTest_AssertPass("About to call SDL_SetRenderDrawColor(renderer, 0xaa, 0xbb, 0xcc, 0x0)");
|
||||
result = SDL_SetRenderDrawColor(software_renderer, 0xaa, 0xbb, 0xcc, 0x0);
|
||||
SDLTest_AssertCheck(result == true, "Result is %d, should be %d", result, true);
|
||||
|
||||
SDLTest_AssertPass("About to call SDL_RenderClear(renderer)");
|
||||
result = SDL_RenderClear(software_renderer);
|
||||
SDLTest_AssertCheck(result == true, "Result is %d, should be %d", result, true);
|
||||
|
||||
SDLTest_AssertPass("About to call SDL_SetRenderDrawColor(renderer, 0x0, 0x0, 0x0, 0x0)");
|
||||
result = SDL_SetRenderDrawColor(software_renderer, 0x0, 0x0, 0x0, 0x0);
|
||||
SDLTest_AssertCheck(result == true, "Result is %d, should be %d", result, true);
|
||||
|
||||
dest_rect.x = 32;
|
||||
dest_rect.y = 32;
|
||||
dest_rect.w = (float)surface2->w;
|
||||
dest_rect.h = (float)surface2->h;
|
||||
point.x = 0;
|
||||
point.y = 0;
|
||||
SDLTest_AssertPass("About to call SDL_RenderCopy(software_renderer, texture, NULL, &{%g, %g, %g, %g})",
|
||||
dest_rect.x, dest_rect.h, dest_rect.w, dest_rect.h);
|
||||
result = SDL_RenderTextureRotated(software_renderer, texture2, NULL, &dest_rect, 180, &point, SDL_FLIP_NONE);
|
||||
SDLTest_AssertCheck(result == true, "Result is %d, should be %d", result, true);
|
||||
|
||||
SDLTest_AssertPass("About to call SDL_RenderPresent(software_renderer)");
|
||||
SDL_RenderPresent(software_renderer);
|
||||
|
||||
SDLTest_AssertPass("About to call SDL_ReadSurfacePixel(0, 0)");
|
||||
result = SDL_ReadSurfacePixel(surface, 0, 0, &r, &g, &b, &a);
|
||||
SDLTest_AssertCheck(result == true, "Result is %d, should be %d", result, true);
|
||||
SDLTest_AssertCheck(r == 0xaa && g == 0xbb && b == 0xcc && a == SDL_ALPHA_OPAQUE,
|
||||
"Pixel at (0, 0) is {0x%02x,0x%02x,0x%02x,0x%02x}, should be {0x%02x,0x%02x,0x%02x,0x%02x}",
|
||||
r, g, b, a, 0xaa, 0xbb, 0xcc, SDL_ALPHA_OPAQUE);
|
||||
|
||||
SDLTest_AssertPass("About to call SDL_ReadSurfacePixel(15, 15)");
|
||||
result = SDL_ReadSurfacePixel(surface, 15, 15, &r, &g, &b, &a);
|
||||
SDLTest_AssertCheck(result == true, "Result is %d, should be %d", result, true);
|
||||
SDLTest_AssertCheck(r == 0xaa && g == 0xbb && b == 0xcc && a == SDL_ALPHA_OPAQUE,
|
||||
"Pixel at (0, 0) is {0x%02x,0x%02x,0x%02x,0x%02x}, should be {0x%02x,0x%02x,0x%02x,0x%02x}",
|
||||
r, g, b, a, 0xaa, 0xbb, 0xcc, SDL_ALPHA_OPAQUE);
|
||||
|
||||
SDLTest_AssertPass("About to call SDL_ReadSurfacePixel(16, 16)");
|
||||
result = SDL_ReadSurfacePixel(surface, 16, 16, &r, &g, &b, &a);
|
||||
SDLTest_AssertCheck(result == true, "Result is %d, should be %d", result, true);
|
||||
SDLTest_AssertCheck(r == 0x00 && g == 0x00 && b == 0x00 && a == SDL_ALPHA_OPAQUE,
|
||||
"Pixel at (0, 0) is {0x%02x,0x%02x,0x%02x,0x%02x}, should be {0x%02x,0x%02x,0x%02x,0x%02x}",
|
||||
r, g, b, a, 0x00, 0x00, 0x00, SDL_ALPHA_OPAQUE);
|
||||
|
||||
SDLTest_AssertPass("About to call SDL_ReadSurfacePixel(31, 31)");
|
||||
result = SDL_ReadSurfacePixel(surface, 31, 31, &r, &g, &b, &a);
|
||||
SDLTest_AssertCheck(result == true, "Result is %d, should be %d", result, true);
|
||||
SDLTest_AssertCheck(r == 0x00 && g == 0x00 && b == 0x00 && a == SDL_ALPHA_OPAQUE,
|
||||
"Pixel at (0, 0) is {0x%02x,0x%02x,0x%02x,0x%02x}, should be {0x%02x,0x%02x,0x%02x,0x%02x}",
|
||||
r, g, b, a, 0x00, 0x00, 0x00, SDL_ALPHA_OPAQUE);
|
||||
|
||||
SDLTest_AssertPass("About to call SDL_ReadSurfacePixel(32, 32)");
|
||||
result = SDL_ReadSurfacePixel(surface, 32, 32, &r, &g, &b, &a);
|
||||
SDLTest_AssertCheck(result == true, "Result is %d, should be %d", result, true);
|
||||
SDLTest_AssertCheck(r == 0xaa && g == 0xbb && b == 0xcc && a == SDL_ALPHA_OPAQUE,
|
||||
"Pixel at (0, 0) is {0x%02x,0x%02x,0x%02x,0x%02x}, should be {0x%02x,0x%02x,0x%02x,0x%02x}",
|
||||
r, g, b, a, 0xaa, 0xbb, 0xcc, SDL_ALPHA_OPAQUE);
|
||||
|
||||
SDL_DestroyTexture(texture2);
|
||||
SDL_DestroySurface(surface2);
|
||||
SDL_DestroyRenderer(software_renderer);
|
||||
SDL_DestroySurface(surface);
|
||||
return TEST_COMPLETED;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test clip rect
|
||||
*/
|
||||
@@ -1226,6 +1532,46 @@ static int SDLCALL render_testLogicalSize(void *arg)
|
||||
return TEST_COMPLETED;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Tests setting and getting texture scale mode.
|
||||
*
|
||||
* \sa
|
||||
* http://wiki.libsdl.org/SDL2/SDL_SetTextureScaleMode
|
||||
* http://wiki.libsdl.org/SDL2/SDL_GetTextureScaleMode
|
||||
*/
|
||||
static int SDLCALL render_testGetSetTextureScaleMode(void *arg)
|
||||
{
|
||||
const struct {
|
||||
const char *name;
|
||||
SDL_ScaleMode mode;
|
||||
} modes[] = {
|
||||
{ "SDL_SCALEMODE_NEAREST", SDL_SCALEMODE_NEAREST },
|
||||
{ "SDL_SCALEMODE_LINEAR", SDL_SCALEMODE_LINEAR },
|
||||
{ "SDL_SCALEMODE_PIXELART", SDL_SCALEMODE_PIXELART },
|
||||
};
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < SDL_arraysize(modes); i++) {
|
||||
SDL_Texture *texture;
|
||||
bool result;
|
||||
SDL_ScaleMode actual_mode = SDL_SCALEMODE_NEAREST;
|
||||
|
||||
SDL_ClearError();
|
||||
SDLTest_AssertPass("About to call SDL_CreateTexture(renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STREAMING, 16, 16)");
|
||||
texture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STREAMING, 16, 16);
|
||||
SDLTest_AssertCheck(texture != NULL, "SDL_CreateTexture must return a non-NULL texture");
|
||||
SDLTest_AssertPass("About to call SDL_SetTextureScaleMode(texture, %s)", modes[i].name);
|
||||
result = SDL_SetTextureScaleMode(texture, modes[i].mode);
|
||||
SDLTest_AssertCheck(result == true, "SDL_SetTextureScaleMode returns %d, expected %d", result, true);
|
||||
SDLTest_AssertPass("About to call SDL_GetTextureScaleMode(texture)");
|
||||
result = SDL_GetTextureScaleMode(texture, &actual_mode);
|
||||
SDLTest_AssertCheck(result == true, "SDL_SetTextureScaleMode returns %d, expected %d", result, true);
|
||||
SDLTest_AssertCheck(actual_mode == modes[i].mode, "SDL_GetTextureScaleMode must return %s (%d), actual=%d",
|
||||
modes[i].name, modes[i].mode, actual_mode);
|
||||
}
|
||||
return TEST_COMPLETED;
|
||||
}
|
||||
|
||||
/* Helper functions */
|
||||
|
||||
/**
|
||||
@@ -1665,6 +2011,10 @@ static const SDLTest_TestCaseReference renderTestBlit9Grid = {
|
||||
render_testBlit9Grid, "render_testBlit9Grid", "Tests 9-grid blitting", TEST_ENABLED
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference renderTestBlit9GridTiled = {
|
||||
render_testBlit9GridTiled, "render_testBlit9GridTiled", "Tests tiled 9-grid blitting", TEST_ENABLED
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference renderTestBlitColor = {
|
||||
render_testBlitColor, "render_testBlitColor", "Tests blitting with color", TEST_ENABLED
|
||||
};
|
||||
@@ -1693,6 +2043,14 @@ static const SDLTest_TestCaseReference renderTestTextureState = {
|
||||
render_testTextureState, "render_testTextureState", "Tests texture state changes", TEST_ENABLED
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference renderTestGetSetTextureScaleMode = {
|
||||
render_testGetSetTextureScaleMode, "render_testGetSetTextureScaleMode", "Tests setting/getting texture scale mode", TEST_ENABLED
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference renderTestRGBSurfaceNoAlpha = {
|
||||
render_testRGBSurfaceNoAlpha, "render_testRGBSurfaceNoAlpha", "Tests RGB surface with no alpha using software renderer", TEST_ENABLED
|
||||
};
|
||||
|
||||
/* Sequence of Render test cases */
|
||||
static const SDLTest_TestCaseReference *renderTests[] = {
|
||||
&renderTestGetNumRenderDrivers,
|
||||
@@ -1701,6 +2059,7 @@ static const SDLTest_TestCaseReference *renderTests[] = {
|
||||
&renderTestBlit,
|
||||
&renderTestBlitTiled,
|
||||
&renderTestBlit9Grid,
|
||||
&renderTestBlit9GridTiled,
|
||||
&renderTestBlitColor,
|
||||
&renderTestBlendModes,
|
||||
&renderTestViewport,
|
||||
@@ -1708,6 +2067,8 @@ static const SDLTest_TestCaseReference *renderTests[] = {
|
||||
&renderTestLogicalSize,
|
||||
&renderTestUVWrapping,
|
||||
&renderTestTextureState,
|
||||
&renderTestGetSetTextureScaleMode,
|
||||
&renderTestRGBSurfaceNoAlpha,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
@@ -959,6 +959,36 @@ static int SDLCALL surface_testBlitBlendMul(void *arg)
|
||||
return TEST_COMPLETED;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests blitting invalid surfaces.
|
||||
*/
|
||||
static int SDLCALL surface_testBlitInvalid(void *arg)
|
||||
{
|
||||
SDL_Surface *valid, *invalid;
|
||||
bool result;
|
||||
|
||||
valid = SDL_CreateSurface(1, 1, SDL_PIXELFORMAT_RGBA8888);
|
||||
SDLTest_AssertCheck(valid != NULL, "Check surface creation");
|
||||
invalid = SDL_CreateSurface(0, 0, SDL_PIXELFORMAT_RGBA8888);
|
||||
SDLTest_AssertCheck(invalid != NULL, "Check surface creation");
|
||||
SDLTest_AssertCheck(invalid->pixels == NULL, "Check surface pixels are NULL");
|
||||
|
||||
result = SDL_BlitSurface(invalid, NULL, valid, NULL);
|
||||
SDLTest_AssertCheck(result == true, "SDL_BlitSurface(invalid, NULL, valid, NULL), result = %s\n", result ? "true" : "false");
|
||||
result = SDL_BlitSurface(valid, NULL, invalid, NULL);
|
||||
SDLTest_AssertCheck(result == true, "SDL_BlitSurface(valid, NULL, invalid, NULL), result = %s\n", result ? "true" : "false");
|
||||
|
||||
result = SDL_BlitSurfaceScaled(invalid, NULL, valid, NULL, SDL_SCALEMODE_NEAREST);
|
||||
SDLTest_AssertCheck(result == false, "SDL_BlitSurfaceScaled(invalid, NULL, valid, NULL, SDL_SCALEMODE_NEAREST), result = %s\n", result ? "true" : "false");
|
||||
result = SDL_BlitSurfaceScaled(valid, NULL, invalid, NULL, SDL_SCALEMODE_NEAREST);
|
||||
SDLTest_AssertCheck(result == false, "SDL_BlitSurfaceScaled(valid, NULL, invalid, NULL, SDL_SCALEMODE_NEAREST), result = %s\n", result ? "true" : "false");
|
||||
|
||||
SDL_DestroySurface(valid);
|
||||
SDL_DestroySurface(invalid);
|
||||
|
||||
return TEST_COMPLETED;
|
||||
}
|
||||
|
||||
static int SDLCALL surface_testOverflow(void *arg)
|
||||
{
|
||||
char buf[1024];
|
||||
@@ -1506,7 +1536,7 @@ static int SDLCALL surface_testScale(void *arg)
|
||||
SDL_PIXELFORMAT_ARGB128_FLOAT, SDL_PIXELFORMAT_RGBA128_FLOAT,
|
||||
};
|
||||
SDL_ScaleMode modes[] = {
|
||||
SDL_SCALEMODE_NEAREST, SDL_SCALEMODE_LINEAR
|
||||
SDL_SCALEMODE_NEAREST, SDL_SCALEMODE_LINEAR, SDL_SCALEMODE_PIXELART
|
||||
};
|
||||
SDL_Surface *surface, *result;
|
||||
SDL_PixelFormat format;
|
||||
@@ -1543,7 +1573,9 @@ static int SDLCALL surface_testScale(void *arg)
|
||||
deltaA <= MAXIMUM_ERROR,
|
||||
"Checking %s %s scaling results, expected %.4f,%.4f,%.4f,%.4f got %.4f,%.4f,%.4f,%.4f",
|
||||
SDL_GetPixelFormatName(format),
|
||||
mode == SDL_SCALEMODE_NEAREST ? "nearest" : "linear",
|
||||
mode == SDL_SCALEMODE_NEAREST ? "nearest" :
|
||||
mode == SDL_SCALEMODE_LINEAR ? "linear" :
|
||||
mode == SDL_SCALEMODE_PIXELART ? "pixelart" : "unknown",
|
||||
srcR, srcG, srcB, srcA, actualR, actualG, actualB, actualA);
|
||||
|
||||
SDL_DestroySurface(surface);
|
||||
@@ -1630,6 +1662,10 @@ static const SDLTest_TestCaseReference surfaceTestBlitBlendMul = {
|
||||
surface_testBlitBlendMul, "surface_testBlitBlendMul", "Tests blitting routines with mul blending mode.", TEST_ENABLED
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference surfaceTestBlitInvalid = {
|
||||
surface_testBlitInvalid, "surface_testBlitInvalid", "Tests blitting routines with invalid surfaces.", TEST_ENABLED
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference surfaceTestOverflow = {
|
||||
surface_testOverflow, "surface_testOverflow", "Test overflow detection.", TEST_ENABLED
|
||||
};
|
||||
@@ -1678,6 +1714,7 @@ static const SDLTest_TestCaseReference *surfaceTests[] = {
|
||||
&surfaceTestBlitBlendAddPremultiplied,
|
||||
&surfaceTestBlitBlendMod,
|
||||
&surfaceTestBlitBlendMul,
|
||||
&surfaceTestBlitInvalid,
|
||||
&surfaceTestOverflow,
|
||||
&surfaceTestFlip,
|
||||
&surfaceTestPalette,
|
||||
|
||||
@@ -2444,6 +2444,33 @@ static int SDLCALL video_getWindowSurface(void *arg)
|
||||
return TEST_COMPLETED;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests SDL_RaiseWindow
|
||||
*/
|
||||
static int SDLCALL video_raiseWindow(void *arg)
|
||||
{
|
||||
bool result;
|
||||
SDL_Window *window;
|
||||
|
||||
SDLTest_AssertPass("SDL_SetWindowInputFocus is not supported on dummy and SDL2 wayland driver");
|
||||
if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "dummy") == 0 || SDL_strcmp(SDL_GetCurrentVideoDriver(), "wayland") == 0) {
|
||||
return TEST_SKIPPED;
|
||||
}
|
||||
|
||||
window = createVideoSuiteTestWindow("video_raiseWindow");
|
||||
if (!window) {
|
||||
return TEST_ABORTED;
|
||||
}
|
||||
|
||||
SDLTest_AssertPass("About to call SDL_RaiseWindow(window)");
|
||||
result = SDL_RaiseWindow(window);
|
||||
SDLTest_AssertCheck(result, "Result is %d, expected 1 (%s)", result, SDL_GetError());
|
||||
|
||||
destroyVideoSuiteTestWindow(window);
|
||||
|
||||
return TEST_COMPLETED;
|
||||
}
|
||||
|
||||
/* ================= Test References ================== */
|
||||
|
||||
/* Video test cases */
|
||||
@@ -2534,6 +2561,9 @@ static const SDLTest_TestCaseReference videoTestCreateMaximized = {
|
||||
static const SDLTest_TestCaseReference videoTestGetWindowSurface = {
|
||||
video_getWindowSurface, "video_getWindowSurface", "Checks window surface functionality", TEST_ENABLED
|
||||
};
|
||||
static const SDLTest_TestCaseReference videoTestRaiseWindow = {
|
||||
video_raiseWindow, "video_raiseWindow", "Checks window focus", TEST_ENABLED
|
||||
};
|
||||
|
||||
/* Sequence of Video test cases */
|
||||
static const SDLTest_TestCaseReference *videoTests[] = {
|
||||
@@ -2559,6 +2589,7 @@ static const SDLTest_TestCaseReference *videoTests[] = {
|
||||
&videoTestCreateMinimized,
|
||||
&videoTestCreateMaximized,
|
||||
&videoTestGetWindowSurface,
|
||||
&videoTestRaiseWindow,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
@@ -32,12 +32,9 @@
|
||||
#define TITLE_HEIGHT 48.0f
|
||||
#define PANEL_SPACING 25.0f
|
||||
#define PANEL_WIDTH 250.0f
|
||||
#define MINIMUM_BUTTON_WIDTH 96.0f
|
||||
#define BUTTON_MARGIN 16.0f
|
||||
#define BUTTON_PADDING 12.0f
|
||||
#define GAMEPAD_WIDTH 512.0f
|
||||
#define GAMEPAD_HEIGHT 560.0f
|
||||
|
||||
#define BUTTON_MARGIN 16.0f
|
||||
#define SCREEN_WIDTH (PANEL_WIDTH + PANEL_SPACING + GAMEPAD_WIDTH + PANEL_SPACING + PANEL_WIDTH)
|
||||
#define SCREEN_HEIGHT (TITLE_HEIGHT + GAMEPAD_HEIGHT)
|
||||
|
||||
@@ -49,6 +46,228 @@ typedef struct
|
||||
int m_nFarthestValue;
|
||||
} AxisState;
|
||||
|
||||
struct Quaternion
|
||||
{
|
||||
float x, y, z, w;
|
||||
};
|
||||
|
||||
static Quaternion quat_identity = { 0.0f, 0.0f, 0.0f, 1.0f };
|
||||
|
||||
Quaternion QuaternionFromEuler(float roll, float pitch, float yaw)
|
||||
{
|
||||
Quaternion q;
|
||||
float cy = SDL_cosf(yaw * 0.5f);
|
||||
float sy = SDL_sinf(yaw * 0.5f);
|
||||
float cp = SDL_cosf(pitch * 0.5f);
|
||||
float sp = SDL_sinf(pitch * 0.5f);
|
||||
float cr = SDL_cosf(roll * 0.5f);
|
||||
float sr = SDL_sinf(roll * 0.5f);
|
||||
|
||||
q.w = cr * cp * cy + sr * sp * sy;
|
||||
q.x = sr * cp * cy - cr * sp * sy;
|
||||
q.y = cr * sp * cy + sr * cp * sy;
|
||||
q.z = cr * cp * sy - sr * sp * cy;
|
||||
|
||||
return q;
|
||||
}
|
||||
|
||||
static void EulerFromQuaternion(Quaternion q, float *roll, float *pitch, float *yaw)
|
||||
{
|
||||
float sinr_cosp = 2.0f * (q.w * q.x + q.y * q.z);
|
||||
float cosr_cosp = 1.0f - 2.0f * (q.x * q.x + q.y * q.y);
|
||||
float roll_rad = SDL_atan2f(sinr_cosp, cosr_cosp);
|
||||
|
||||
float sinp = 2.0f * (q.w * q.y - q.z * q.x);
|
||||
float pitch_rad;
|
||||
if (SDL_fabsf(sinp) >= 1.0f) {
|
||||
pitch_rad = SDL_copysignf(SDL_PI_F / 2.0f, sinp);
|
||||
} else {
|
||||
pitch_rad = SDL_asinf(sinp);
|
||||
}
|
||||
|
||||
float siny_cosp = 2.0f * (q.w * q.z + q.x * q.y);
|
||||
float cosy_cosp = 1.0f - 2.0f * (q.y * q.y + q.z * q.z);
|
||||
float yaw_rad = SDL_atan2f(siny_cosp, cosy_cosp);
|
||||
|
||||
if (roll)
|
||||
*roll = roll_rad;
|
||||
if (pitch)
|
||||
*pitch = pitch_rad;
|
||||
if (yaw)
|
||||
*yaw = yaw_rad;
|
||||
}
|
||||
|
||||
static void EulerDegreesFromQuaternion(Quaternion q, float *pitch, float *yaw, float *roll)
|
||||
{
|
||||
float pitch_rad, yaw_rad, roll_rad;
|
||||
EulerFromQuaternion(q, &pitch_rad, &yaw_rad, &roll_rad);
|
||||
if (pitch) {
|
||||
*pitch = pitch_rad * (180.0f / SDL_PI_F);
|
||||
}
|
||||
if (yaw) {
|
||||
*yaw = yaw_rad * (180.0f / SDL_PI_F);
|
||||
}
|
||||
if (roll) {
|
||||
*roll = roll_rad * (180.0f / SDL_PI_F);
|
||||
}
|
||||
}
|
||||
|
||||
Quaternion MultiplyQuaternion(Quaternion a, Quaternion b)
|
||||
{
|
||||
Quaternion q;
|
||||
q.x = a.x * b.w + a.y * b.z - a.z * b.y + a.w * b.x;
|
||||
q.y = -a.x * b.z + a.y * b.w + a.z * b.x + a.w * b.y;
|
||||
q.z = a.x * b.y - a.y * b.x + a.z * b.w + a.w * b.z;
|
||||
q.w = -a.x * b.x - a.y * b.y - a.z * b.z + a.w * b.w;
|
||||
return q;
|
||||
}
|
||||
|
||||
void NormalizeQuaternion(Quaternion *q)
|
||||
{
|
||||
float mag = SDL_sqrtf(q->x * q->x + q->y * q->y + q->z * q->z + q->w * q->w);
|
||||
if (mag > 0.0f) {
|
||||
q->x /= mag;
|
||||
q->y /= mag;
|
||||
q->z /= mag;
|
||||
q->w /= mag;
|
||||
}
|
||||
}
|
||||
|
||||
float Normalize180(float angle)
|
||||
{
|
||||
angle = SDL_fmodf(angle + 180.0f, 360.0f);
|
||||
if (angle < 0.0f) {
|
||||
angle += 360.0f;
|
||||
}
|
||||
return angle - 180.0f;
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Uint64 gyro_packet_number;
|
||||
Uint64 accelerometer_packet_number;
|
||||
/* When both gyro and accelerometer events have been processed, we can increment this and use it to calculate polling rate over time.*/
|
||||
Uint64 imu_packet_counter;
|
||||
|
||||
Uint64 starting_time_stamp_ns; /* Use this to help estimate how many packets are received over a duration */
|
||||
Uint16 imu_estimated_sensor_rate; /* in Hz, used to estimate how many packets are received over a duration */
|
||||
|
||||
Uint64 last_sensor_time_stamp_ns;/* Comes from the event data/HID implementation. Official PS5/Edge gives true hardware time stamps. Others are simulated. Nanoseconds i.e. 1e9 */
|
||||
|
||||
/* Fresh data copied from sensor events. */
|
||||
float accel_data[3]; /* Meters per second squared, i.e. 9.81f means 9.81 meters per second squared */
|
||||
float gyro_data[3]; /* Degrees per second, i.e. 100.0f means 100 degrees per second */
|
||||
|
||||
float last_accel_data[3];/* Needed to detect motion (and inhibit drift calibration) */
|
||||
float accelerometer_length_squared;
|
||||
float gyro_drift_accumulator[3];
|
||||
bool is_calibrating_drift; /* Starts on, but can be turned back on by the user to restart the drift calibration. */
|
||||
int gyro_drift_sample_count;
|
||||
float gyro_drift_solution[3]; /* Non zero if calibration is complete. */
|
||||
|
||||
Quaternion integrated_rotation; /* Used to help test whether the time stamps and gyro degrees per second are set up correctly by the HID implementation */
|
||||
} IMUState;
|
||||
|
||||
/* Reset the Drift calculation state */
|
||||
void StartGyroDriftCalibration(IMUState *imustate)
|
||||
{
|
||||
imustate->is_calibrating_drift = true;
|
||||
imustate->gyro_drift_sample_count = 0;
|
||||
SDL_zeroa(imustate->gyro_drift_solution);
|
||||
SDL_zeroa(imustate->gyro_drift_accumulator);
|
||||
}
|
||||
void ResetIMUState(IMUState *imustate)
|
||||
{
|
||||
imustate->gyro_packet_number = 0;
|
||||
imustate->accelerometer_packet_number = 0;
|
||||
imustate->starting_time_stamp_ns = SDL_GetTicksNS();
|
||||
imustate->integrated_rotation = quat_identity;
|
||||
imustate->accelerometer_length_squared = 0.0f;
|
||||
imustate->integrated_rotation = quat_identity;
|
||||
SDL_zeroa(imustate->last_accel_data);
|
||||
SDL_zeroa(imustate->gyro_drift_solution);
|
||||
StartGyroDriftCalibration(imustate);
|
||||
}
|
||||
|
||||
void ResetGyroOrientation(IMUState *imustate)
|
||||
{
|
||||
imustate->integrated_rotation = quat_identity;
|
||||
}
|
||||
|
||||
/* More samples = more accurate drift correction, but also more time to calibrate.*/
|
||||
#define SDL_GAMEPAD_IMU_MIN_GYRO_DRIFT_SAMPLE_COUNT 1024
|
||||
|
||||
/*
|
||||
* Average drift _per packet_ as opposed to _per second_
|
||||
* This reduces a small amount of overhead when applying the drift correction.
|
||||
*/
|
||||
void FinalizeDriftSolution(IMUState *imustate)
|
||||
{
|
||||
if (imustate->gyro_drift_sample_count >= SDL_GAMEPAD_IMU_MIN_GYRO_DRIFT_SAMPLE_COUNT) {
|
||||
imustate->gyro_drift_solution[0] = imustate->gyro_drift_accumulator[0] / (float)imustate->gyro_drift_sample_count;
|
||||
imustate->gyro_drift_solution[1] = imustate->gyro_drift_accumulator[1] / (float)imustate->gyro_drift_sample_count;
|
||||
imustate->gyro_drift_solution[2] = imustate->gyro_drift_accumulator[2] / (float)imustate->gyro_drift_sample_count;
|
||||
}
|
||||
|
||||
imustate->is_calibrating_drift = false;
|
||||
ResetGyroOrientation(imustate);
|
||||
}
|
||||
|
||||
/* Sample gyro packet in order to calculate drift*/
|
||||
void SampleGyroPacketForDrift( IMUState *imustate )
|
||||
{
|
||||
if ( !imustate->is_calibrating_drift )
|
||||
return;
|
||||
|
||||
/* Get the length squared difference of the last accelerometer data vs. the new one */
|
||||
float accelerometer_difference[3];
|
||||
accelerometer_difference[0] = imustate->accel_data[0] - imustate->last_accel_data[0];
|
||||
accelerometer_difference[1] = imustate->accel_data[1] - imustate->last_accel_data[1];
|
||||
accelerometer_difference[2] = imustate->accel_data[2] - imustate->last_accel_data[2];
|
||||
SDL_memcpy(imustate->last_accel_data, imustate->accel_data, sizeof(imustate->last_accel_data));
|
||||
|
||||
imustate->accelerometer_length_squared = accelerometer_difference[0] * accelerometer_difference[0] + accelerometer_difference[1] * accelerometer_difference[1] + accelerometer_difference[2] * accelerometer_difference[2];
|
||||
|
||||
/* Ideal threshold will vary considerably depending on IMU. PS5 needs a low value (0.05f). Nintendo Switch needs a higher value (0.15f). */
|
||||
const float flAccelerometerMovementThreshold = ACCELEROMETER_NOISE_THRESHOLD;
|
||||
if (imustate->accelerometer_length_squared > flAccelerometerMovementThreshold * flAccelerometerMovementThreshold) {
|
||||
/* Reset the drift calibration if the accelerometer has moved significantly */
|
||||
StartGyroDriftCalibration(imustate);
|
||||
} else {
|
||||
/* Sensor is stationary enough to evaluate for drift.*/
|
||||
++imustate->gyro_drift_sample_count;
|
||||
|
||||
imustate->gyro_drift_accumulator[0] += imustate->gyro_data[0];
|
||||
imustate->gyro_drift_accumulator[1] += imustate->gyro_data[1];
|
||||
imustate->gyro_drift_accumulator[2] += imustate->gyro_data[2];
|
||||
|
||||
if (imustate->gyro_drift_sample_count >= SDL_GAMEPAD_IMU_MIN_GYRO_DRIFT_SAMPLE_COUNT) {
|
||||
FinalizeDriftSolution(imustate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ApplyDriftSolution(float *gyro_data, const float *drift_solution)
|
||||
{
|
||||
gyro_data[0] -= drift_solution[0];
|
||||
gyro_data[1] -= drift_solution[1];
|
||||
gyro_data[2] -= drift_solution[2];
|
||||
}
|
||||
|
||||
void UpdateGyroRotation(IMUState *imustate, Uint64 sensorTimeStampDelta_ns)
|
||||
{
|
||||
float sensorTimeDeltaTimeSeconds = SDL_NS_TO_SECONDS((float)sensorTimeStampDelta_ns);
|
||||
/* Integrate speeds to get Rotational Displacement*/
|
||||
float pitch = imustate->gyro_data[0] * sensorTimeDeltaTimeSeconds;
|
||||
float yaw = imustate->gyro_data[1] * sensorTimeDeltaTimeSeconds;
|
||||
float roll = imustate->gyro_data[2] * sensorTimeDeltaTimeSeconds;
|
||||
|
||||
/* Use quaternions to avoid gimbal lock*/
|
||||
Quaternion delta_rotation = QuaternionFromEuler(pitch, yaw, roll);
|
||||
imustate->integrated_rotation = MultiplyQuaternion(imustate->integrated_rotation, delta_rotation);
|
||||
NormalizeQuaternion(&imustate->integrated_rotation);
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
SDL_JoystickID id;
|
||||
@@ -56,6 +275,7 @@ typedef struct
|
||||
SDL_Joystick *joystick;
|
||||
int num_axes;
|
||||
AxisState *axis_state;
|
||||
IMUState *imu_state;
|
||||
|
||||
SDL_Gamepad *gamepad;
|
||||
char *mapping;
|
||||
@@ -71,6 +291,7 @@ static SDL_Renderer *screen = NULL;
|
||||
static ControllerDisplayMode display_mode = CONTROLLER_MODE_TESTING;
|
||||
static GamepadImage *image = NULL;
|
||||
static GamepadDisplay *gamepad_elements = NULL;
|
||||
static GyroDisplay *gyro_elements = NULL;
|
||||
static GamepadTypeDisplay *gamepad_type = NULL;
|
||||
static JoystickDisplay *joystick_elements = NULL;
|
||||
static GamepadButton *setup_mapping_button = NULL;
|
||||
@@ -265,6 +486,8 @@ static void ClearButtonHighlights(void)
|
||||
ClearGamepadImage(image);
|
||||
SetGamepadDisplayHighlight(gamepad_elements, SDL_GAMEPAD_ELEMENT_INVALID, false);
|
||||
SetGamepadTypeDisplayHighlight(gamepad_type, SDL_GAMEPAD_TYPE_UNSELECTED, false);
|
||||
SetGamepadButtonHighlight(GetGyroResetButton( gyro_elements ), false, false);
|
||||
SetGamepadButtonHighlight(GetGyroCalibrateButton(gyro_elements), false, false);
|
||||
SetGamepadButtonHighlight(setup_mapping_button, false, false);
|
||||
SetGamepadButtonHighlight(done_mapping_button, false, false);
|
||||
SetGamepadButtonHighlight(cancel_button, false, false);
|
||||
@@ -276,6 +499,8 @@ static void ClearButtonHighlights(void)
|
||||
static void UpdateButtonHighlights(float x, float y, bool button_down)
|
||||
{
|
||||
ClearButtonHighlights();
|
||||
SetGamepadButtonHighlight(GetGyroResetButton(gyro_elements), GamepadButtonContains(GetGyroResetButton(gyro_elements), x, y), button_down);
|
||||
SetGamepadButtonHighlight(GetGyroCalibrateButton(gyro_elements), GamepadButtonContains(GetGyroCalibrateButton(gyro_elements), x, y), button_down);
|
||||
|
||||
if (display_mode == CONTROLLER_MODE_TESTING) {
|
||||
SetGamepadButtonHighlight(setup_mapping_button, GamepadButtonContains(setup_mapping_button, x, y), button_down);
|
||||
@@ -915,6 +1140,8 @@ static void AddController(SDL_JoystickID id, bool verbose)
|
||||
if (new_controller->joystick) {
|
||||
new_controller->num_axes = SDL_GetNumJoystickAxes(new_controller->joystick);
|
||||
new_controller->axis_state = (AxisState *)SDL_calloc(new_controller->num_axes, sizeof(*new_controller->axis_state));
|
||||
new_controller->imu_state = (IMUState *)SDL_calloc(1, sizeof(*new_controller->imu_state));
|
||||
ResetIMUState(new_controller->imu_state);
|
||||
}
|
||||
|
||||
joystick = new_controller->joystick;
|
||||
@@ -959,6 +1186,9 @@ static void DelController(SDL_JoystickID id)
|
||||
if (controllers[i].axis_state) {
|
||||
SDL_free(controllers[i].axis_state);
|
||||
}
|
||||
if (controllers[i].imu_state) {
|
||||
SDL_free(controllers[i].imu_state);
|
||||
}
|
||||
if (controllers[i].joystick) {
|
||||
SDL_CloseJoystick(controllers[i].joystick);
|
||||
}
|
||||
@@ -1133,6 +1363,99 @@ static void HandleGamepadRemoved(SDL_JoystickID id)
|
||||
controllers[i].gamepad = NULL;
|
||||
}
|
||||
}
|
||||
static void HandleGamepadAccelerometerEvent(SDL_Event *event)
|
||||
{
|
||||
controller->imu_state->accelerometer_packet_number++;
|
||||
SDL_memcpy(controller->imu_state->accel_data, event->gsensor.data, sizeof(controller->imu_state->accel_data));
|
||||
}
|
||||
|
||||
static void HandleGamepadGyroEvent(SDL_Event *event)
|
||||
{
|
||||
controller->imu_state->gyro_packet_number++;
|
||||
SDL_memcpy(controller->imu_state->gyro_data, event->gsensor.data, sizeof(controller->imu_state->gyro_data));
|
||||
}
|
||||
|
||||
#define SDL_GAMEPAD_IMU_MIN_POLLING_RATE_ESTIMATION_COUNT 2048
|
||||
static void EstimatePacketRate()
|
||||
{
|
||||
Uint64 now_ns = SDL_GetTicksNS();
|
||||
if (controller->imu_state->imu_packet_counter == 0) {
|
||||
controller->imu_state->starting_time_stamp_ns = now_ns;
|
||||
}
|
||||
|
||||
/* Require a significant sample size before averaging rate. */
|
||||
if (controller->imu_state->imu_packet_counter >= SDL_GAMEPAD_IMU_MIN_POLLING_RATE_ESTIMATION_COUNT) {
|
||||
Uint64 deltatime_ns = now_ns - controller->imu_state->starting_time_stamp_ns;
|
||||
controller->imu_state->imu_estimated_sensor_rate = (Uint16)((controller->imu_state->imu_packet_counter * 1000000000ULL) / deltatime_ns);
|
||||
}
|
||||
|
||||
/* Flush sampled data after a brief period so that the imu_estimated_sensor_rate value can be read.*/
|
||||
if (controller->imu_state->imu_packet_counter >= SDL_GAMEPAD_IMU_MIN_POLLING_RATE_ESTIMATION_COUNT * 2) {
|
||||
controller->imu_state->starting_time_stamp_ns = now_ns;
|
||||
controller->imu_state->imu_packet_counter = 0;
|
||||
}
|
||||
++controller->imu_state->imu_packet_counter;
|
||||
}
|
||||
|
||||
static void UpdateGamepadOrientation( Uint64 delta_time_ns )
|
||||
{
|
||||
if (!controller || !controller->imu_state)
|
||||
return;
|
||||
|
||||
SampleGyroPacketForDrift(controller->imu_state);
|
||||
ApplyDriftSolution(controller->imu_state->gyro_data, controller->imu_state->gyro_drift_solution);
|
||||
UpdateGyroRotation(controller->imu_state, delta_time_ns);
|
||||
}
|
||||
|
||||
static void HandleGamepadSensorEvent( SDL_Event* event )
|
||||
{
|
||||
if (!controller) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (controller->id != event->gsensor.which) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (event->gsensor.sensor == SDL_SENSOR_GYRO) {
|
||||
HandleGamepadGyroEvent(event);
|
||||
} else if (event->gsensor.sensor == SDL_SENSOR_ACCEL) {
|
||||
HandleGamepadAccelerometerEvent(event);
|
||||
}
|
||||
|
||||
/*
|
||||
This is where we can update the quaternion because we need to have a drift solution, which requires both
|
||||
accelerometer and gyro events are received before progressing.
|
||||
*/
|
||||
if ( controller->imu_state->accelerometer_packet_number == controller->imu_state->gyro_packet_number ) {
|
||||
|
||||
EstimatePacketRate();
|
||||
Uint64 sensorTimeStampDelta_ns = event->gsensor.sensor_timestamp - controller->imu_state->last_sensor_time_stamp_ns ;
|
||||
UpdateGamepadOrientation(sensorTimeStampDelta_ns);
|
||||
|
||||
float display_euler_angles[3];
|
||||
EulerDegreesFromQuaternion(controller->imu_state->integrated_rotation, &display_euler_angles[0], &display_euler_angles[1], &display_euler_angles[2]);
|
||||
|
||||
float drift_calibration_progress_frac = controller->imu_state->gyro_drift_sample_count / (float)SDL_GAMEPAD_IMU_MIN_GYRO_DRIFT_SAMPLE_COUNT;
|
||||
int reported_polling_rate_hz = sensorTimeStampDelta_ns > 0 ? (int)(SDL_NS_PER_SECOND / sensorTimeStampDelta_ns) : 0;
|
||||
|
||||
/* Send the results to the frontend */
|
||||
SetGamepadDisplayIMUValues(gyro_elements,
|
||||
controller->imu_state->gyro_drift_solution,
|
||||
display_euler_angles,
|
||||
&controller->imu_state->integrated_rotation,
|
||||
reported_polling_rate_hz,
|
||||
controller->imu_state->imu_estimated_sensor_rate,
|
||||
drift_calibration_progress_frac,
|
||||
controller->imu_state->accelerometer_length_squared
|
||||
);
|
||||
|
||||
/* Also show the gyro correction next to the gyro speed - this is useful in turntable tests as you can use a turntable to calibrate for drift, and that drift correction is functionally the same as the turn table speed (ignoring drift) */
|
||||
SetGamepadDisplayGyroDriftCorrection(gamepad_elements, controller->imu_state->gyro_drift_solution);
|
||||
|
||||
controller->imu_state->last_sensor_time_stamp_ns = event->gsensor.sensor_timestamp;
|
||||
}
|
||||
}
|
||||
|
||||
static Uint16 ConvertAxisToRumble(Sint16 axisval)
|
||||
{
|
||||
@@ -1296,7 +1619,9 @@ static void VirtualGamepadMouseDown(float x, float y)
|
||||
int element = GetGamepadImageElementAt(image, x, y);
|
||||
|
||||
if (element == SDL_GAMEPAD_ELEMENT_INVALID) {
|
||||
SDL_FPoint point = { x, y };
|
||||
SDL_FPoint point;
|
||||
point.x = x;
|
||||
point.y = y;
|
||||
SDL_FRect touchpad;
|
||||
GetGamepadTouchpadArea(image, &touchpad);
|
||||
if (SDL_PointInRectFloat(&point, &touchpad)) {
|
||||
@@ -1738,8 +2063,9 @@ SDL_AppResult SDLCALL SDL_AppEvent(void *appstate, SDL_Event *event)
|
||||
break;
|
||||
#endif /* VERBOSE_TOUCHPAD */
|
||||
|
||||
#ifdef VERBOSE_SENSORS
|
||||
|
||||
case SDL_EVENT_GAMEPAD_SENSOR_UPDATE:
|
||||
#ifdef VERBOSE_SENSORS
|
||||
SDL_Log("Gamepad %" SDL_PRIu32 " sensor %s: %.2f, %.2f, %.2f (%" SDL_PRIu64 ")",
|
||||
event->gsensor.which,
|
||||
GetSensorName((SDL_SensorType) event->gsensor.sensor),
|
||||
@@ -1747,8 +2073,10 @@ SDL_AppResult SDLCALL SDL_AppEvent(void *appstate, SDL_Event *event)
|
||||
event->gsensor.data[1],
|
||||
event->gsensor.data[2],
|
||||
event->gsensor.sensor_timestamp);
|
||||
break;
|
||||
|
||||
#endif /* VERBOSE_SENSORS */
|
||||
HandleGamepadSensorEvent(event);
|
||||
break;
|
||||
|
||||
#ifdef VERBOSE_AXES
|
||||
case SDL_EVENT_GAMEPAD_AXIS_MOTION:
|
||||
@@ -1807,7 +2135,11 @@ SDL_AppResult SDLCALL SDL_AppEvent(void *appstate, SDL_Event *event)
|
||||
}
|
||||
|
||||
if (display_mode == CONTROLLER_MODE_TESTING) {
|
||||
if (GamepadButtonContains(setup_mapping_button, event->button.x, event->button.y)) {
|
||||
if (GamepadButtonContains(GetGyroResetButton(gyro_elements), event->button.x, event->button.y)) {
|
||||
ResetGyroOrientation(controller->imu_state);
|
||||
} else if (GamepadButtonContains(GetGyroCalibrateButton(gyro_elements), event->button.x, event->button.y)) {
|
||||
StartGyroDriftCalibration(controller->imu_state);
|
||||
} else if (GamepadButtonContains(setup_mapping_button, event->button.x, event->button.y)) {
|
||||
SetDisplayMode(CONTROLLER_MODE_BINDING);
|
||||
}
|
||||
} else if (display_mode == CONTROLLER_MODE_BINDING) {
|
||||
@@ -1886,6 +2218,10 @@ SDL_AppResult SDLCALL SDL_AppEvent(void *appstate, SDL_Event *event)
|
||||
SDL_ReloadGamepadMappings();
|
||||
} else if (event->key.key == SDLK_ESCAPE) {
|
||||
done = true;
|
||||
} else if (event->key.key == SDLK_SPACE) {
|
||||
if (controller && controller->imu_state) {
|
||||
ResetGyroOrientation(controller->imu_state);
|
||||
}
|
||||
}
|
||||
} else if (display_mode == CONTROLLER_MODE_BINDING) {
|
||||
if (event->key.key == SDLK_C && (event->key.mod & SDL_KMOD_CTRL)) {
|
||||
@@ -1994,6 +2330,7 @@ SDL_AppResult SDLCALL SDL_AppIterate(void *appstate)
|
||||
|
||||
if (display_mode == CONTROLLER_MODE_TESTING) {
|
||||
RenderGamepadButton(setup_mapping_button);
|
||||
RenderGyroDisplay(gyro_elements, gamepad_elements, controller->gamepad);
|
||||
} else if (display_mode == CONTROLLER_MODE_BINDING) {
|
||||
DrawBindingTips(screen);
|
||||
RenderGamepadButton(done_mapping_button);
|
||||
@@ -2148,6 +2485,17 @@ SDL_AppResult SDLCALL SDL_AppInit(void **appstate, int argc, char *argv[])
|
||||
area.h = GAMEPAD_HEIGHT;
|
||||
SetGamepadDisplayArea(gamepad_elements, &area);
|
||||
|
||||
gyro_elements = CreateGyroDisplay(screen);
|
||||
const float vidReservedHeight = 24.0f;
|
||||
/* Bottom right of the screen */
|
||||
area.w = SCREEN_WIDTH * 0.375f;
|
||||
area.h = SCREEN_HEIGHT * 0.475f;
|
||||
area.x = SCREEN_WIDTH - area.w;
|
||||
area.y = SCREEN_HEIGHT - area.h - vidReservedHeight;
|
||||
|
||||
SetGyroDisplayArea(gyro_elements, &area);
|
||||
InitCirclePoints3D();
|
||||
|
||||
gamepad_type = CreateGamepadTypeDisplay(screen);
|
||||
area.x = 0;
|
||||
area.y = TITLE_HEIGHT;
|
||||
@@ -2227,6 +2575,7 @@ void SDLCALL SDL_AppQuit(void *appstate, SDL_AppResult result)
|
||||
SDL_free(controller_name);
|
||||
DestroyGamepadImage(image);
|
||||
DestroyGamepadDisplay(gamepad_elements);
|
||||
DestroyGyroDisplay(gyro_elements);
|
||||
DestroyGamepadTypeDisplay(gamepad_type);
|
||||
DestroyJoystickDisplay(joystick_elements);
|
||||
DestroyGamepadButton(setup_mapping_button);
|
||||
|
||||
@@ -15,8 +15,9 @@
|
||||
#include <SDL3/SDL_main.h>
|
||||
#include <SDL3/SDL_test.h>
|
||||
|
||||
const SDL_DialogFileFilter filters[3] = {
|
||||
const SDL_DialogFileFilter filters[] = {
|
||||
{ "All files", "*" },
|
||||
{ "SVI Session Indexes", "index;svi-index;index.pb" },
|
||||
{ "JPG images", "jpg;jpeg" },
|
||||
{ "PNG images", "png" }
|
||||
};
|
||||
@@ -54,7 +55,6 @@ int main(int argc, char *argv[])
|
||||
const SDL_FRect open_folder_rect = { 370, 50, 220, 140 };
|
||||
int i;
|
||||
const char *initial_path = NULL;
|
||||
const int nfilters = sizeof(filters) / sizeof(*filters);
|
||||
|
||||
/* Initialize test framework */
|
||||
state = SDLTest_CommonCreateState(argv, 0);
|
||||
@@ -112,11 +112,11 @@ int main(int argc, char *argv[])
|
||||
* - Nonzero if the user is allowed to choose multiple entries (not for SDL_ShowSaveFileDialog)
|
||||
*/
|
||||
if (SDL_PointInRectFloat(&p, &open_file_rect)) {
|
||||
SDL_ShowOpenFileDialog(callback, NULL, w, filters, nfilters, initial_path, 1);
|
||||
SDL_ShowOpenFileDialog(callback, NULL, w, filters, SDL_arraysize(filters), initial_path, 1);
|
||||
} else if (SDL_PointInRectFloat(&p, &open_folder_rect)) {
|
||||
SDL_ShowOpenFolderDialog(callback, NULL, w, initial_path, 1);
|
||||
} else if (SDL_PointInRectFloat(&p, &save_file_rect)) {
|
||||
SDL_ShowSaveFileDialog(callback, NULL, w, filters, nfilters, initial_path);
|
||||
SDL_ShowSaveFileDialog(callback, NULL, w, filters, SDL_arraysize(filters), initial_path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -679,6 +679,16 @@ void SetupVulkanRenderProperties(VulkanVideoContext *context, SDL_PropertiesID p
|
||||
SDL_SetNumberProperty(props, SDL_PROP_RENDERER_CREATE_VULKAN_GRAPHICS_QUEUE_FAMILY_INDEX_NUMBER, context->graphicsQueueFamilyIndex);
|
||||
}
|
||||
|
||||
#if LIBAVUTIL_VERSION_MAJOR >= 59
|
||||
static void AddQueueFamily(AVVulkanDeviceContext *ctx, int idx, int num, VkQueueFlagBits flags)
|
||||
{
|
||||
AVVulkanDeviceQueueFamily *entry = &ctx->qf[ctx->nb_qf++];
|
||||
entry->idx = idx;
|
||||
entry->num = num;
|
||||
entry->flags = flags;
|
||||
}
|
||||
#endif /* LIBAVUTIL_VERSION_MAJOR */
|
||||
|
||||
void SetupVulkanDeviceContextData(VulkanVideoContext *context, AVVulkanDeviceContext *ctx)
|
||||
{
|
||||
ctx->get_proc_addr = context->vkGetInstanceProcAddr;
|
||||
@@ -690,6 +700,12 @@ void SetupVulkanDeviceContextData(VulkanVideoContext *context, AVVulkanDeviceCon
|
||||
ctx->nb_enabled_inst_extensions = context->instanceExtensionsCount;
|
||||
ctx->enabled_dev_extensions = context->deviceExtensions;
|
||||
ctx->nb_enabled_dev_extensions = context->deviceExtensionsCount;
|
||||
#if LIBAVUTIL_VERSION_MAJOR >= 59
|
||||
AddQueueFamily(ctx, context->graphicsQueueFamilyIndex, context->graphicsQueueCount, VK_QUEUE_GRAPHICS_BIT);
|
||||
AddQueueFamily(ctx, context->transferQueueFamilyIndex, context->transferQueueCount, VK_QUEUE_TRANSFER_BIT);
|
||||
AddQueueFamily(ctx, context->computeQueueFamilyIndex, context->computeQueueCount, VK_QUEUE_COMPUTE_BIT);
|
||||
AddQueueFamily(ctx, context->decodeQueueFamilyIndex, context->decodeQueueCount, VK_QUEUE_VIDEO_DECODE_BIT_KHR);
|
||||
#else
|
||||
ctx->queue_family_index = context->graphicsQueueFamilyIndex;
|
||||
ctx->nb_graphics_queues = context->graphicsQueueCount;
|
||||
ctx->queue_family_tx_index = context->transferQueueFamilyIndex;
|
||||
@@ -700,6 +716,7 @@ void SetupVulkanDeviceContextData(VulkanVideoContext *context, AVVulkanDeviceCon
|
||||
ctx->nb_encode_queues = 0;
|
||||
ctx->queue_family_decode_index = context->decodeQueueFamilyIndex;
|
||||
ctx->nb_decode_queues = context->decodeQueueCount;
|
||||
#endif /* LIBAVUTIL_VERSION_MAJOR */
|
||||
}
|
||||
|
||||
static int CreateCommandBuffers(VulkanVideoContext *context, SDL_Renderer *renderer)
|
||||
|
||||
@@ -28,7 +28,6 @@ static bool use_texture = false;
|
||||
static SDL_Texture **sprites;
|
||||
static SDL_BlendMode blendMode = SDL_BLENDMODE_NONE;
|
||||
static float angle = 0.0f;
|
||||
static int sprite_w, sprite_h;
|
||||
static int translate_cx = 0;
|
||||
static int translate_cy = 0;
|
||||
|
||||
@@ -52,7 +51,7 @@ static int LoadSprite(const char *file)
|
||||
|
||||
for (i = 0; i < state->num_windows; ++i) {
|
||||
/* This does the SDL_LoadBMP step repeatedly, but that's OK for test code. */
|
||||
sprites[i] = LoadTexture(state->renderers[i], file, true, &sprite_w, &sprite_h);
|
||||
sprites[i] = LoadTexture(state->renderers[i], file, true);
|
||||
if (!sprites[i]) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,339 @@
|
||||
/*
|
||||
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely.
|
||||
*/
|
||||
|
||||
#define SDL_MAIN_USE_CALLBACKS 1 /* use the callbacks instead of main() */
|
||||
#include <SDL3/SDL.h>
|
||||
#include <SDL3/SDL_main.h>
|
||||
|
||||
#include "testutils.h"
|
||||
|
||||
#include "testgpurender_effects_grayscale.frag.dxil.h"
|
||||
#include "testgpurender_effects_grayscale.frag.msl.h"
|
||||
#include "testgpurender_effects_grayscale.frag.spv.h"
|
||||
#include "testgpurender_effects_CRT.frag.dxil.h"
|
||||
#include "testgpurender_effects_CRT.frag.msl.h"
|
||||
#include "testgpurender_effects_CRT.frag.spv.h"
|
||||
|
||||
/* The window is twice the size of the background */
|
||||
#define WINDOW_WIDTH (408 * 2)
|
||||
#define WINDOW_HEIGHT (167 * 2)
|
||||
#define NUM_SPRITES 15
|
||||
#define MAX_SPEED 1
|
||||
|
||||
static SDL_Window *window = NULL;
|
||||
static SDL_Renderer *renderer = NULL;
|
||||
static SDL_Texture *target = NULL;
|
||||
static SDL_GPUDevice *device = NULL;
|
||||
static SDL_Texture *background;
|
||||
static SDL_Texture *sprite;
|
||||
static SDL_FRect positions[NUM_SPRITES];
|
||||
static SDL_FRect velocities[NUM_SPRITES];
|
||||
|
||||
typedef enum
|
||||
{
|
||||
EFFECT_NONE,
|
||||
EFFECT_GRAYSCALE,
|
||||
EFFECT_CRT,
|
||||
NUM_EFFECTS
|
||||
} FullscreenEffect;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
const char *name;
|
||||
const unsigned char *dxil_shader_source;
|
||||
unsigned int dxil_shader_source_len;
|
||||
const unsigned char *msl_shader_source;
|
||||
unsigned int msl_shader_source_len;
|
||||
const unsigned char *spirv_shader_source;
|
||||
unsigned int spirv_shader_source_len;
|
||||
int num_samplers;
|
||||
int num_uniform_buffers;
|
||||
SDL_GPUShader *shader;
|
||||
SDL_GPURenderState *state;
|
||||
} FullscreenEffectData;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float texture_width;
|
||||
float texture_height;
|
||||
} CRTEffectUniforms;
|
||||
|
||||
static FullscreenEffectData effects[] = {
|
||||
{
|
||||
"NONE",
|
||||
NULL,
|
||||
0,
|
||||
NULL,
|
||||
0,
|
||||
NULL,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
NULL
|
||||
},
|
||||
{
|
||||
"Grayscale",
|
||||
testgpu_effects_grayscale_frag_dxil,
|
||||
sizeof(testgpu_effects_grayscale_frag_dxil),
|
||||
testgpu_effects_grayscale_frag_msl,
|
||||
sizeof(testgpu_effects_grayscale_frag_msl),
|
||||
testgpu_effects_grayscale_frag_spv,
|
||||
sizeof(testgpu_effects_grayscale_frag_spv),
|
||||
1,
|
||||
0,
|
||||
NULL,
|
||||
NULL
|
||||
},
|
||||
{
|
||||
"CRT monitor",
|
||||
testgpu_effects_CRT_frag_dxil,
|
||||
sizeof(testgpu_effects_CRT_frag_dxil),
|
||||
testgpu_effects_CRT_frag_msl,
|
||||
sizeof(testgpu_effects_CRT_frag_msl),
|
||||
testgpu_effects_CRT_frag_spv,
|
||||
sizeof(testgpu_effects_CRT_frag_spv),
|
||||
1,
|
||||
1,
|
||||
NULL,
|
||||
NULL
|
||||
}
|
||||
};
|
||||
SDL_COMPILE_TIME_ASSERT(effects, SDL_arraysize(effects) == NUM_EFFECTS);
|
||||
|
||||
static int current_effect = 0;
|
||||
|
||||
static void DrawScene(void)
|
||||
{
|
||||
int i;
|
||||
int window_w = WINDOW_WIDTH;
|
||||
int window_h = WINDOW_HEIGHT;
|
||||
SDL_FRect *position, *velocity;
|
||||
|
||||
SDL_RenderTexture(renderer, background, NULL, NULL);
|
||||
|
||||
/* Move the sprite, bounce at the wall, and draw */
|
||||
for (i = 0; i < NUM_SPRITES; ++i) {
|
||||
position = &positions[i];
|
||||
velocity = &velocities[i];
|
||||
position->x += velocity->x;
|
||||
if ((position->x < 0) || (position->x >= (window_w - sprite->w))) {
|
||||
velocity->x = -velocity->x;
|
||||
position->x += velocity->x;
|
||||
}
|
||||
position->y += velocity->y;
|
||||
if ((position->y < 0) || (position->y >= (window_h - sprite->h))) {
|
||||
velocity->y = -velocity->y;
|
||||
position->y += velocity->y;
|
||||
}
|
||||
|
||||
/* Blit the sprite onto the screen */
|
||||
SDL_RenderTexture(renderer, sprite, NULL, position);
|
||||
}
|
||||
}
|
||||
|
||||
static bool InitGPURenderState(void)
|
||||
{
|
||||
SDL_GPUShaderFormat formats;
|
||||
SDL_GPUShaderCreateInfo info;
|
||||
SDL_GPURenderStateDesc desc;
|
||||
int i;
|
||||
|
||||
formats = SDL_GetGPUShaderFormats(device);
|
||||
if (formats == SDL_GPU_SHADERFORMAT_INVALID) {
|
||||
SDL_Log("Couldn't get supported shader formats: %s", SDL_GetError());
|
||||
return false;
|
||||
}
|
||||
|
||||
for (i = 0; i < SDL_arraysize(effects); ++i) {
|
||||
FullscreenEffectData *data = &effects[i];
|
||||
|
||||
if (i == EFFECT_NONE) {
|
||||
continue;
|
||||
}
|
||||
|
||||
SDL_zero(info);
|
||||
if (formats & SDL_GPU_SHADERFORMAT_SPIRV) {
|
||||
info.format = SDL_GPU_SHADERFORMAT_SPIRV;
|
||||
info.code = data->spirv_shader_source;
|
||||
info.code_size = data->spirv_shader_source_len;
|
||||
} else if (formats & SDL_GPU_SHADERFORMAT_DXIL) {
|
||||
info.format = SDL_GPU_SHADERFORMAT_DXIL;
|
||||
info.code = data->dxil_shader_source;
|
||||
info.code_size = data->dxil_shader_source_len;
|
||||
} else if (formats & SDL_GPU_SHADERFORMAT_MSL) {
|
||||
info.format = SDL_GPU_SHADERFORMAT_MSL;
|
||||
info.code = data->msl_shader_source;
|
||||
info.code_size = data->msl_shader_source_len;
|
||||
} else {
|
||||
SDL_Log("No supported shader format found");
|
||||
return false;
|
||||
}
|
||||
info.num_samplers = data->num_samplers;
|
||||
info.num_uniform_buffers = data->num_uniform_buffers;
|
||||
info.stage = SDL_GPU_SHADERSTAGE_FRAGMENT;
|
||||
data->shader = SDL_CreateGPUShader(device, &info);
|
||||
if (!data->shader) {
|
||||
SDL_Log("Couldn't create shader: %s", SDL_GetError());
|
||||
return false;
|
||||
}
|
||||
|
||||
SDL_INIT_INTERFACE(&desc);
|
||||
desc.fragment_shader = data->shader;
|
||||
data->state = SDL_CreateGPURenderState(renderer, &desc);
|
||||
if (!data->state) {
|
||||
SDL_Log("Couldn't create render state: %s", SDL_GetError());
|
||||
return false;
|
||||
}
|
||||
|
||||
if (i == EFFECT_CRT) {
|
||||
CRTEffectUniforms uniforms;
|
||||
SDL_zero(uniforms);
|
||||
uniforms.texture_width = (float)target->w;
|
||||
uniforms.texture_height = (float)target->h;
|
||||
if (!SDL_SetGPURenderStateFragmentUniforms(data->state, 0, &uniforms, sizeof(uniforms))) {
|
||||
SDL_Log("Couldn't set uniform data: %s", SDL_GetError());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static void QuitGPURenderState(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < SDL_arraysize(effects); ++i) {
|
||||
FullscreenEffectData *data = &effects[i];
|
||||
|
||||
if (i == EFFECT_NONE) {
|
||||
continue;
|
||||
}
|
||||
|
||||
SDL_DestroyGPURenderState(data->state);
|
||||
SDL_ReleaseGPUShader(device, data->shader);
|
||||
}
|
||||
}
|
||||
|
||||
/* This function runs once at startup. */
|
||||
SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
|
||||
{
|
||||
const char *description = "GPU render effects example";
|
||||
int i;
|
||||
|
||||
SDL_SetAppMetadata(description, "1.0", "com.example.testgpurender_effects");
|
||||
|
||||
if (!SDL_Init(SDL_INIT_VIDEO)) {
|
||||
SDL_Log("Couldn't initialize SDL: %s", SDL_GetError());
|
||||
return SDL_APP_FAILURE;
|
||||
}
|
||||
|
||||
window = SDL_CreateWindow(description, WINDOW_WIDTH, WINDOW_HEIGHT, 0);
|
||||
if (!window) {
|
||||
SDL_Log("Couldn't create window: %s", SDL_GetError());
|
||||
return SDL_APP_FAILURE;
|
||||
}
|
||||
|
||||
renderer = SDL_CreateGPURenderer(window, SDL_GPU_SHADERFORMAT_SPIRV | SDL_GPU_SHADERFORMAT_DXIL | SDL_GPU_SHADERFORMAT_MSL, &device);
|
||||
if (!renderer || !device) {
|
||||
SDL_Log("Couldn't create renderer: %s", SDL_GetError());
|
||||
return SDL_APP_FAILURE;
|
||||
}
|
||||
SDL_SetRenderVSync(renderer, 1);
|
||||
|
||||
target = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_TARGET, WINDOW_WIDTH, WINDOW_HEIGHT);
|
||||
if (!target) {
|
||||
SDL_Log("Couldn't create target texture: %s", SDL_GetError());
|
||||
return SDL_APP_FAILURE;
|
||||
}
|
||||
|
||||
background = LoadTexture(renderer, "sample.bmp", false);
|
||||
if (!background) {
|
||||
SDL_Log("Couldn't create background: %s", SDL_GetError());
|
||||
return SDL_APP_FAILURE;
|
||||
}
|
||||
|
||||
sprite = LoadTexture(renderer, "icon.bmp", true);
|
||||
if (!sprite) {
|
||||
SDL_Log("Couldn't create sprite: %s", SDL_GetError());
|
||||
return SDL_APP_FAILURE;
|
||||
}
|
||||
|
||||
/* Initialize the sprite positions */
|
||||
for (i = 0; i < NUM_SPRITES; ++i) {
|
||||
positions[i].x = (float)SDL_rand(WINDOW_WIDTH - sprite->w);
|
||||
positions[i].y = (float)SDL_rand(WINDOW_HEIGHT - sprite->h);
|
||||
positions[i].w = (float)sprite->w;
|
||||
positions[i].h = (float)sprite->h;
|
||||
velocities[i].x = 0.0f;
|
||||
velocities[i].y = 0.0f;
|
||||
while (velocities[i].x == 0.f && velocities[i].y == 0.f) {
|
||||
velocities[i].x = (float)(SDL_rand(MAX_SPEED * 2 + 1) - MAX_SPEED);
|
||||
velocities[i].y = (float)(SDL_rand(MAX_SPEED * 2 + 1) - MAX_SPEED);
|
||||
}
|
||||
}
|
||||
|
||||
if (!InitGPURenderState()) {
|
||||
return SDL_APP_FAILURE;
|
||||
}
|
||||
|
||||
return SDL_APP_CONTINUE; /* carry on with the program! */
|
||||
}
|
||||
|
||||
/* This function runs when a new event (mouse input, keypresses, etc) occurs. */
|
||||
SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event)
|
||||
{
|
||||
if (event->type == SDL_EVENT_QUIT ||
|
||||
(event->type == SDL_EVENT_KEY_DOWN && event->key.key == SDLK_ESCAPE)) {
|
||||
return SDL_APP_SUCCESS; /* end the program, reporting success to the OS. */
|
||||
}
|
||||
if (event->type == SDL_EVENT_KEY_DOWN) {
|
||||
if (event->key.key == SDLK_SPACE) {
|
||||
current_effect = (current_effect + 1) % NUM_EFFECTS;
|
||||
}
|
||||
}
|
||||
return SDL_APP_CONTINUE; /* carry on with the program! */
|
||||
}
|
||||
|
||||
/* This function runs once per frame, and is the heart of the program. */
|
||||
SDL_AppResult SDL_AppIterate(void *appstate)
|
||||
{
|
||||
FullscreenEffectData *effect = &effects[current_effect];
|
||||
|
||||
/* Draw the scene to the render target */
|
||||
SDL_SetRenderTarget(renderer, target);
|
||||
DrawScene();
|
||||
SDL_SetRenderTarget(renderer, NULL);
|
||||
|
||||
/* Display the render target with the fullscreen effect */
|
||||
SDL_SetRenderGPUState(renderer, effect->state);
|
||||
SDL_RenderTexture(renderer, target, NULL, NULL);
|
||||
SDL_SetRenderGPUState(renderer, NULL);
|
||||
|
||||
/* Draw some help text */
|
||||
SDL_SetRenderDrawColor(renderer, 255, 255, 255, SDL_ALPHA_OPAQUE);
|
||||
SDL_RenderDebugTextFormat(renderer, 4.0f, WINDOW_HEIGHT - SDL_DEBUG_TEXT_FONT_CHARACTER_SIZE - 4.0f,
|
||||
"Current effect: %s, press SPACE to cycle", effect->name);
|
||||
|
||||
SDL_RenderPresent(renderer);
|
||||
|
||||
return SDL_APP_CONTINUE; /* carry on with the program! */
|
||||
}
|
||||
|
||||
/* This function runs once at shutdown. */
|
||||
void SDL_AppQuit(void *appstate, SDL_AppResult result)
|
||||
{
|
||||
/* SDL will clean up the window/renderer for us. */
|
||||
QuitGPURenderState();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,392 @@
|
||||
static const unsigned char testgpu_effects_CRT_frag_dxil[] = {
|
||||
0x44, 0x58, 0x42, 0x43, 0xfc, 0x37, 0x25, 0xf8, 0x2a, 0xa6, 0x16, 0x0c,
|
||||
0xe6, 0x1f, 0x75, 0x7e, 0x5a, 0x39, 0x2b, 0x5a, 0x01, 0x00, 0x00, 0x00,
|
||||
0x38, 0x12, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00,
|
||||
0x4c, 0x00, 0x00, 0x00, 0xa8, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00,
|
||||
0xf0, 0x01, 0x00, 0x00, 0x50, 0x09, 0x00, 0x00, 0x6c, 0x09, 0x00, 0x00,
|
||||
0x53, 0x46, 0x49, 0x30, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x31, 0x54, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0x00, 0x00, 0x00,
|
||||
0x4f, 0x53, 0x47, 0x31, 0x34, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x53, 0x56, 0x5f, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x00, 0x00, 0x00,
|
||||
0x50, 0x53, 0x56, 0x30, 0x04, 0x01, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
|
||||
0x00, 0x00, 0x00, 0x00, 0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x13, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x18, 0x00, 0x00, 0x00, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52,
|
||||
0x44, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0x6d,
|
||||
0x61, 0x69, 0x6e, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x44, 0x00, 0x03, 0x02, 0x00, 0x00,
|
||||
0x0a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x42, 0x00,
|
||||
0x03, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x44, 0x10, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
|
||||
0x0f, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x53, 0x54, 0x41, 0x54, 0x58, 0x07, 0x00, 0x00,
|
||||
0x60, 0x00, 0x00, 0x00, 0xd6, 0x01, 0x00, 0x00, 0x44, 0x58, 0x49, 0x4c,
|
||||
0x00, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x40, 0x07, 0x00, 0x00,
|
||||
0x42, 0x43, 0xc0, 0xde, 0x21, 0x0c, 0x00, 0x00, 0xcd, 0x01, 0x00, 0x00,
|
||||
0x0b, 0x82, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00,
|
||||
0x07, 0x81, 0x23, 0x91, 0x41, 0xc8, 0x04, 0x49, 0x06, 0x10, 0x32, 0x39,
|
||||
0x92, 0x01, 0x84, 0x0c, 0x25, 0x05, 0x08, 0x19, 0x1e, 0x04, 0x8b, 0x62,
|
||||
0x80, 0x18, 0x45, 0x02, 0x42, 0x92, 0x0b, 0x42, 0xc4, 0x10, 0x32, 0x14,
|
||||
0x38, 0x08, 0x18, 0x4b, 0x0a, 0x32, 0x62, 0x88, 0x48, 0x90, 0x14, 0x20,
|
||||
0x43, 0x46, 0x88, 0xa5, 0x00, 0x19, 0x32, 0x42, 0xe4, 0x48, 0x0e, 0x90,
|
||||
0x11, 0x23, 0xc4, 0x50, 0x41, 0x51, 0x81, 0x8c, 0xe1, 0x83, 0xe5, 0x8a,
|
||||
0x04, 0x31, 0x46, 0x06, 0x51, 0x18, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
|
||||
0x1b, 0x8c, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x40, 0x02, 0xa8, 0x0d,
|
||||
0x84, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x20, 0x6d, 0x30, 0x86, 0xff,
|
||||
0xff, 0xff, 0xff, 0x1f, 0x00, 0x09, 0xa8, 0x00, 0x49, 0x18, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x13, 0x82, 0x60, 0x42, 0x20, 0x4c, 0x08, 0x06,
|
||||
0x00, 0x00, 0x00, 0x00, 0x89, 0x20, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00,
|
||||
0x32, 0x22, 0x88, 0x09, 0x20, 0x64, 0x85, 0x04, 0x13, 0x23, 0xa4, 0x84,
|
||||
0x04, 0x13, 0x23, 0xe3, 0x84, 0xa1, 0x90, 0x14, 0x12, 0x4c, 0x8c, 0x8c,
|
||||
0x0b, 0x84, 0xc4, 0x4c, 0x10, 0x90, 0xc1, 0x08, 0x40, 0x09, 0x00, 0x0a,
|
||||
0x66, 0x00, 0xe6, 0x08, 0xc0, 0x60, 0x8e, 0x00, 0x29, 0xc6, 0x40, 0x10,
|
||||
0x44, 0x41, 0x90, 0x51, 0x0c, 0x80, 0x20, 0x88, 0x62, 0x20, 0xa4, 0x18,
|
||||
0x03, 0x31, 0x0c, 0xc3, 0x40, 0xca, 0x4d, 0xc3, 0xe5, 0x4f, 0xd8, 0x43,
|
||||
0x48, 0xfe, 0x4a, 0x48, 0x2b, 0x31, 0xf9, 0xc5, 0x6d, 0xa3, 0x62, 0x18,
|
||||
0x86, 0x81, 0xa0, 0xe2, 0x9e, 0xe1, 0xf2, 0x27, 0xec, 0x21, 0x24, 0x3f,
|
||||
0x04, 0x9a, 0x61, 0x21, 0x50, 0xd0, 0x14, 0x86, 0x21, 0x1c, 0x67, 0x18,
|
||||
0x86, 0x81, 0x20, 0x88, 0x81, 0x9e, 0x32, 0x0c, 0xc4, 0x40, 0xd1, 0x51,
|
||||
0xc3, 0xe5, 0x4f, 0xd8, 0x43, 0x48, 0x3e, 0xb7, 0x51, 0xc5, 0x4a, 0x4c,
|
||||
0x7e, 0x71, 0xdb, 0x88, 0x18, 0x86, 0x61, 0x28, 0xc4, 0x44, 0x38, 0x04,
|
||||
0x51, 0x73, 0x04, 0x41, 0x31, 0x1c, 0xa2, 0x20, 0x08, 0x8b, 0xae, 0x81,
|
||||
0x80, 0x61, 0x04, 0x62, 0x98, 0xa9, 0x0d, 0xc6, 0x81, 0x1d, 0xc2, 0x61,
|
||||
0x1e, 0xe6, 0xc1, 0x0d, 0x68, 0xa1, 0x1c, 0xf0, 0x81, 0x1e, 0xea, 0x41,
|
||||
0x1e, 0xca, 0x41, 0x0e, 0x48, 0x81, 0x0f, 0xec, 0xa1, 0x1c, 0xc6, 0x81,
|
||||
0x1e, 0xde, 0x41, 0x1e, 0xf8, 0xc0, 0x1c, 0xd8, 0xe1, 0x1d, 0xc2, 0x81,
|
||||
0x1e, 0xd8, 0x00, 0x0c, 0xe8, 0xc0, 0x0f, 0xc0, 0xc0, 0x0f, 0xf4, 0x40,
|
||||
0x0f, 0xda, 0x21, 0x1d, 0xe0, 0x61, 0x1e, 0x7e, 0x81, 0x1e, 0xf2, 0x01,
|
||||
0x1e, 0xca, 0x01, 0x05, 0xc4, 0x4c, 0x62, 0x30, 0x0e, 0xec, 0x10, 0x0e,
|
||||
0xf3, 0x30, 0x0f, 0x6e, 0x40, 0x0b, 0xe5, 0x80, 0x0f, 0xf4, 0x50, 0x0f,
|
||||
0xf2, 0x50, 0x0e, 0x72, 0x40, 0x0a, 0x7c, 0x60, 0x0f, 0xe5, 0x30, 0x0e,
|
||||
0xf4, 0xf0, 0x0e, 0xf2, 0xc0, 0x07, 0xe6, 0xc0, 0x0e, 0xef, 0x10, 0x0e,
|
||||
0xf4, 0xc0, 0x06, 0x60, 0x40, 0x07, 0x7e, 0x00, 0x06, 0x7e, 0x80, 0x04,
|
||||
0x6d, 0x23, 0x6e, 0x18, 0x41, 0x18, 0x8e, 0x99, 0xb0, 0x87, 0xf8, 0x39,
|
||||
0xa7, 0x99, 0x88, 0x6b, 0x42, 0x81, 0x47, 0xdf, 0x4d, 0xd2, 0x14, 0x51,
|
||||
0xc2, 0xe4, 0xb3, 0x00, 0xf3, 0x2c, 0x44, 0xc4, 0x4e, 0xc0, 0x44, 0xa0,
|
||||
0x80, 0xa0, 0x30, 0x11, 0x08, 0x00, 0x00, 0x00, 0x13, 0x14, 0x72, 0xc0,
|
||||
0x87, 0x74, 0x60, 0x87, 0x36, 0x68, 0x87, 0x79, 0x68, 0x03, 0x72, 0xc0,
|
||||
0x87, 0x0d, 0xaf, 0x50, 0x0e, 0x6d, 0xd0, 0x0e, 0x7a, 0x50, 0x0e, 0x6d,
|
||||
0x00, 0x0f, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d,
|
||||
0x90, 0x0e, 0x71, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x78,
|
||||
0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x71, 0x60, 0x07, 0x7a,
|
||||
0x30, 0x07, 0x72, 0xd0, 0x06, 0xe9, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x73,
|
||||
0x20, 0x07, 0x6d, 0x90, 0x0e, 0x76, 0x40, 0x07, 0x7a, 0x60, 0x07, 0x74,
|
||||
0xd0, 0x06, 0xe6, 0x10, 0x07, 0x76, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d,
|
||||
0x60, 0x0e, 0x73, 0x20, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0, 0x06, 0xe6,
|
||||
0x60, 0x07, 0x74, 0xa0, 0x07, 0x76, 0x40, 0x07, 0x6d, 0xe0, 0x0e, 0x78,
|
||||
0xa0, 0x07, 0x71, 0x60, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x76,
|
||||
0x40, 0x07, 0x43, 0x9e, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x86, 0x3c, 0x06, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x0c, 0x79, 0x10, 0x20, 0x00, 0x04, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0xf2, 0x28, 0x40, 0x00, 0x04, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xe4, 0x79, 0x80, 0x00, 0x18,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0xc8, 0x13, 0x01, 0x01,
|
||||
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x90, 0x87, 0x02,
|
||||
0x02, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x21, 0xcf,
|
||||
0x05, 0x04, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x59,
|
||||
0x20, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x32, 0x1e, 0x98, 0x14,
|
||||
0x19, 0x11, 0x4c, 0x90, 0x8c, 0x09, 0x26, 0x47, 0xc6, 0x04, 0x43, 0x22,
|
||||
0x4a, 0x60, 0x04, 0xa0, 0x18, 0x8a, 0xa0, 0x24, 0xca, 0xa0, 0x20, 0xca,
|
||||
0xa1, 0x34, 0xca, 0xa3, 0x98, 0x8a, 0xaf, 0x10, 0xa8, 0x28, 0x89, 0x11,
|
||||
0x80, 0x22, 0x28, 0x84, 0x02, 0xa1, 0x6e, 0x06, 0x80, 0xbe, 0x19, 0x00,
|
||||
0x02, 0x67, 0x00, 0x48, 0x9c, 0x01, 0xa0, 0x71, 0x2c, 0xc4, 0x20, 0x02,
|
||||
0x81, 0x40, 0x9e, 0x07, 0x00, 0x00, 0x00, 0x00, 0x79, 0x18, 0x00, 0x00,
|
||||
0x91, 0x00, 0x00, 0x00, 0x1a, 0x03, 0x4c, 0x90, 0x46, 0x02, 0x13, 0xc4,
|
||||
0x8e, 0x0c, 0x6f, 0xec, 0xed, 0x4d, 0x0c, 0x24, 0xc6, 0x05, 0xc7, 0x45,
|
||||
0xa6, 0x06, 0x46, 0xc6, 0x05, 0x07, 0x04, 0x45, 0x8c, 0xe6, 0x26, 0x26,
|
||||
0x06, 0x67, 0x26, 0xa7, 0x2c, 0x65, 0x43, 0x10, 0x4c, 0x10, 0x08, 0x64,
|
||||
0x82, 0x40, 0x24, 0x1b, 0x84, 0x81, 0xd8, 0x20, 0x10, 0x04, 0x05, 0xb8,
|
||||
0xb9, 0x09, 0x02, 0xa1, 0x6c, 0x18, 0x0e, 0x84, 0x98, 0x20, 0x74, 0x1a,
|
||||
0x93, 0xba, 0x2f, 0xba, 0x32, 0x3c, 0xba, 0x3a, 0xb9, 0xb2, 0x09, 0x02,
|
||||
0xb1, 0x4c, 0x10, 0x08, 0x66, 0x83, 0x40, 0x34, 0x1b, 0x12, 0x42, 0x59,
|
||||
0x18, 0x62, 0x60, 0x08, 0x67, 0x43, 0xf0, 0x4c, 0x10, 0xc0, 0x80, 0x23,
|
||||
0x43, 0x97, 0x07, 0x57, 0xf6, 0x35, 0xf4, 0xe6, 0x46, 0x57, 0x86, 0x47,
|
||||
0x37, 0x41, 0x20, 0x9a, 0x09, 0x02, 0xe1, 0x6c, 0x40, 0x88, 0x48, 0x9a,
|
||||
0x88, 0x81, 0x02, 0x36, 0x04, 0xd5, 0x04, 0x41, 0x0c, 0x3a, 0x26, 0x75,
|
||||
0x5f, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x1b, 0x10, 0xe2, 0xc2,
|
||||
0x18, 0x62, 0x20, 0x80, 0x0d, 0x41, 0xb6, 0x81, 0x80, 0x00, 0x4b, 0x9b,
|
||||
0x20, 0x7c, 0x1b, 0xa5, 0xa1, 0x37, 0x37, 0xba, 0x32, 0x3c, 0xba, 0x2f,
|
||||
0xb9, 0xb2, 0xb9, 0x37, 0xb6, 0x3a, 0xba, 0xb4, 0x37, 0xb7, 0x09, 0x02,
|
||||
0xf1, 0x4c, 0x10, 0x08, 0x68, 0x03, 0x82, 0x74, 0x13, 0xe1, 0x35, 0x1f,
|
||||
0xb3, 0x41, 0xa0, 0xc0, 0x60, 0xc3, 0x40, 0x70, 0x61, 0x30, 0x41, 0x10,
|
||||
0x80, 0x0d, 0xc0, 0x86, 0x81, 0x20, 0x03, 0x32, 0xd8, 0x10, 0x94, 0xc1,
|
||||
0x86, 0x61, 0x18, 0x03, 0x33, 0x98, 0x20, 0x8c, 0x81, 0xb7, 0x21, 0x40,
|
||||
0x03, 0x12, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0xa8, 0x8a, 0xb0, 0x86, 0x9e,
|
||||
0x9e, 0xa4, 0x88, 0x26, 0x08, 0x45, 0x35, 0x41, 0x28, 0xac, 0x0d, 0x01,
|
||||
0x31, 0x41, 0x28, 0xae, 0x09, 0x42, 0x81, 0x4d, 0x10, 0x88, 0x68, 0x83,
|
||||
0x30, 0xc5, 0xc1, 0x86, 0x85, 0x58, 0x03, 0x36, 0x68, 0x03, 0x37, 0x78,
|
||||
0x83, 0x01, 0x0e, 0x88, 0x36, 0x90, 0x83, 0x0d, 0xc1, 0xb0, 0x41, 0x98,
|
||||
0xa6, 0x0d, 0xcb, 0xb0, 0x06, 0x6c, 0xd0, 0x06, 0x74, 0xf0, 0x06, 0xc3,
|
||||
0x1b, 0x0c, 0x6d, 0x50, 0x07, 0x1b, 0x84, 0x39, 0xb0, 0x03, 0x26, 0x53,
|
||||
0x56, 0x5f, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x13, 0x84, 0x22, 0xdb,
|
||||
0xb0, 0x10, 0x78, 0xc0, 0x06, 0x79, 0xe0, 0x06, 0x6d, 0x30, 0xc0, 0x01,
|
||||
0xd1, 0x06, 0x72, 0xb0, 0x21, 0xd0, 0x83, 0x0d, 0xc3, 0x1d, 0xec, 0x01,
|
||||
0xb0, 0xa1, 0x18, 0x03, 0x35, 0xe0, 0x83, 0x0d, 0xa0, 0x61, 0xc6, 0xf6,
|
||||
0x16, 0x46, 0x37, 0x37, 0x41, 0x20, 0x24, 0x16, 0x69, 0x6e, 0x73, 0x74,
|
||||
0x73, 0x13, 0x04, 0x62, 0xa2, 0x31, 0x97, 0x76, 0xf6, 0xc5, 0x46, 0x46,
|
||||
0x63, 0x2e, 0xed, 0xec, 0x6b, 0x8e, 0x6e, 0x82, 0x40, 0x50, 0x44, 0xe8,
|
||||
0xca, 0xf0, 0xbe, 0xdc, 0xde, 0xe4, 0xda, 0x36, 0x28, 0x7e, 0xf0, 0x07,
|
||||
0xa0, 0x10, 0x0a, 0xa2, 0x80, 0x8c, 0x02, 0x29, 0x94, 0xc2, 0x50, 0x85,
|
||||
0x8d, 0xcd, 0xae, 0xcd, 0x25, 0x8d, 0xac, 0xcc, 0x8d, 0x6e, 0x4a, 0x10,
|
||||
0x54, 0x21, 0xc3, 0x73, 0xb1, 0x2b, 0x93, 0x9b, 0x4b, 0x7b, 0x73, 0x9b,
|
||||
0x12, 0x10, 0x4d, 0xc8, 0xf0, 0x5c, 0xec, 0xc2, 0xd8, 0xec, 0xca, 0xe4,
|
||||
0xa6, 0x04, 0x45, 0x1d, 0x32, 0x3c, 0x97, 0x39, 0xb4, 0x30, 0xb2, 0x32,
|
||||
0xb9, 0xa6, 0x37, 0xb2, 0x32, 0xb6, 0x29, 0x01, 0x52, 0x86, 0x0c, 0xcf,
|
||||
0x45, 0xae, 0x6c, 0xee, 0xad, 0x4e, 0x6e, 0xac, 0x6c, 0x6e, 0x4a, 0xa0,
|
||||
0x55, 0x22, 0xc3, 0x73, 0xa1, 0xcb, 0x83, 0x2b, 0x0b, 0x72, 0x73, 0x7b,
|
||||
0xa3, 0x0b, 0xa3, 0x4b, 0x7b, 0x73, 0x9b, 0x9b, 0x22, 0x84, 0x81, 0x19,
|
||||
0xd4, 0x21, 0xc3, 0x73, 0xb1, 0x4b, 0x2b, 0xbb, 0x4b, 0x22, 0x9b, 0xa2,
|
||||
0x0b, 0xa3, 0x2b, 0x9b, 0x12, 0xa0, 0x41, 0x1d, 0x32, 0x3c, 0x97, 0x32,
|
||||
0x37, 0x3a, 0xb9, 0x3c, 0xa8, 0xb7, 0x34, 0x37, 0xba, 0xb9, 0x29, 0x01,
|
||||
0x1f, 0x74, 0x21, 0xc3, 0x73, 0x19, 0x7b, 0xab, 0x73, 0xa3, 0x2b, 0x93,
|
||||
0x9b, 0x9b, 0x12, 0x94, 0x02, 0x00, 0x00, 0x00, 0x79, 0x18, 0x00, 0x00,
|
||||
0x4c, 0x00, 0x00, 0x00, 0x33, 0x08, 0x80, 0x1c, 0xc4, 0xe1, 0x1c, 0x66,
|
||||
0x14, 0x01, 0x3d, 0x88, 0x43, 0x38, 0x84, 0xc3, 0x8c, 0x42, 0x80, 0x07,
|
||||
0x79, 0x78, 0x07, 0x73, 0x98, 0x71, 0x0c, 0xe6, 0x00, 0x0f, 0xed, 0x10,
|
||||
0x0e, 0xf4, 0x80, 0x0e, 0x33, 0x0c, 0x42, 0x1e, 0xc2, 0xc1, 0x1d, 0xce,
|
||||
0xa1, 0x1c, 0x66, 0x30, 0x05, 0x3d, 0x88, 0x43, 0x38, 0x84, 0x83, 0x1b,
|
||||
0xcc, 0x03, 0x3d, 0xc8, 0x43, 0x3d, 0x8c, 0x03, 0x3d, 0xcc, 0x78, 0x8c,
|
||||
0x74, 0x70, 0x07, 0x7b, 0x08, 0x07, 0x79, 0x48, 0x87, 0x70, 0x70, 0x07,
|
||||
0x7a, 0x70, 0x03, 0x76, 0x78, 0x87, 0x70, 0x20, 0x87, 0x19, 0xcc, 0x11,
|
||||
0x0e, 0xec, 0x90, 0x0e, 0xe1, 0x30, 0x0f, 0x6e, 0x30, 0x0f, 0xe3, 0xf0,
|
||||
0x0e, 0xf0, 0x50, 0x0e, 0x33, 0x10, 0xc4, 0x1d, 0xde, 0x21, 0x1c, 0xd8,
|
||||
0x21, 0x1d, 0xc2, 0x61, 0x1e, 0x66, 0x30, 0x89, 0x3b, 0xbc, 0x83, 0x3b,
|
||||
0xd0, 0x43, 0x39, 0xb4, 0x03, 0x3c, 0xbc, 0x83, 0x3c, 0x84, 0x03, 0x3b,
|
||||
0xcc, 0xf0, 0x14, 0x76, 0x60, 0x07, 0x7b, 0x68, 0x07, 0x37, 0x68, 0x87,
|
||||
0x72, 0x68, 0x07, 0x37, 0x80, 0x87, 0x70, 0x90, 0x87, 0x70, 0x60, 0x07,
|
||||
0x76, 0x28, 0x07, 0x76, 0xf8, 0x05, 0x76, 0x78, 0x87, 0x77, 0x80, 0x87,
|
||||
0x5f, 0x08, 0x87, 0x71, 0x18, 0x87, 0x72, 0x98, 0x87, 0x79, 0x98, 0x81,
|
||||
0x2c, 0xee, 0xf0, 0x0e, 0xee, 0xe0, 0x0e, 0xf5, 0xc0, 0x0e, 0xec, 0x30,
|
||||
0x03, 0x62, 0xc8, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c, 0xcc, 0xa1, 0x1c, 0xe4,
|
||||
0xa1, 0x1c, 0xdc, 0x61, 0x1c, 0xca, 0x21, 0x1c, 0xc4, 0x81, 0x1d, 0xca,
|
||||
0x61, 0x06, 0xd6, 0x90, 0x43, 0x39, 0xc8, 0x43, 0x39, 0x98, 0x43, 0x39,
|
||||
0xc8, 0x43, 0x39, 0xb8, 0xc3, 0x38, 0x94, 0x43, 0x38, 0x88, 0x03, 0x3b,
|
||||
0x94, 0xc3, 0x2f, 0xbc, 0x83, 0x3c, 0xfc, 0x82, 0x3b, 0xd4, 0x03, 0x3b,
|
||||
0xb0, 0xc3, 0x8c, 0xc8, 0x21, 0x07, 0x7c, 0x70, 0x03, 0x72, 0x10, 0x87,
|
||||
0x73, 0x70, 0x03, 0x7b, 0x08, 0x07, 0x79, 0x60, 0x87, 0x70, 0xc8, 0x87,
|
||||
0x77, 0xa8, 0x07, 0x7a, 0x98, 0x81, 0x3c, 0xe4, 0x80, 0x0f, 0x6e, 0x40,
|
||||
0x0f, 0xe5, 0xd0, 0x0e, 0xf0, 0x00, 0x00, 0x00, 0x71, 0x20, 0x00, 0x00,
|
||||
0x1e, 0x00, 0x00, 0x00, 0x66, 0xb0, 0x0d, 0x97, 0xef, 0x3c, 0xbe, 0x10,
|
||||
0x50, 0x45, 0x41, 0x44, 0xa5, 0x03, 0x0c, 0x25, 0x61, 0x00, 0x02, 0xe6,
|
||||
0x17, 0xb7, 0x6d, 0x07, 0xd2, 0x70, 0xf9, 0xce, 0xe3, 0x0b, 0x11, 0x01,
|
||||
0x4c, 0x44, 0x08, 0x34, 0xc3, 0x42, 0xd8, 0x80, 0x33, 0x5c, 0xbe, 0xf3,
|
||||
0xf8, 0x83, 0x33, 0xd9, 0x7e, 0x71, 0xdb, 0x16, 0x30, 0x0d, 0x97, 0xef,
|
||||
0x3c, 0xfe, 0xe2, 0x00, 0x83, 0xd8, 0x3c, 0xd4, 0xe4, 0x17, 0xb7, 0x6d,
|
||||
0x04, 0xd0, 0x70, 0xf9, 0xce, 0xe3, 0x4b, 0x00, 0xf3, 0x2c, 0x84, 0x5f,
|
||||
0xdc, 0xb6, 0x09, 0x54, 0xc3, 0xe5, 0x3b, 0x8f, 0x2f, 0x4d, 0x4e, 0x44,
|
||||
0xa0, 0xd4, 0xf4, 0x50, 0x93, 0x5f, 0xdc, 0xb6, 0x15, 0x3c, 0xc3, 0xe5,
|
||||
0x3b, 0x8f, 0x4f, 0x35, 0x40, 0x84, 0xf9, 0xc5, 0x6d, 0x1b, 0x00, 0xc1,
|
||||
0x00, 0x48, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x41, 0x53, 0x48,
|
||||
0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x8a, 0x1a, 0xfd,
|
||||
0x5f, 0xde, 0x04, 0xb4, 0xb6, 0x99, 0xe5, 0xcf, 0x84, 0xe3, 0x07, 0x28,
|
||||
0x44, 0x58, 0x49, 0x4c, 0xc4, 0x08, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00,
|
||||
0x31, 0x02, 0x00, 0x00, 0x44, 0x58, 0x49, 0x4c, 0x00, 0x01, 0x00, 0x00,
|
||||
0x10, 0x00, 0x00, 0x00, 0xac, 0x08, 0x00, 0x00, 0x42, 0x43, 0xc0, 0xde,
|
||||
0x21, 0x0c, 0x00, 0x00, 0x28, 0x02, 0x00, 0x00, 0x0b, 0x82, 0x20, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x07, 0x81, 0x23, 0x91,
|
||||
0x41, 0xc8, 0x04, 0x49, 0x06, 0x10, 0x32, 0x39, 0x92, 0x01, 0x84, 0x0c,
|
||||
0x25, 0x05, 0x08, 0x19, 0x1e, 0x04, 0x8b, 0x62, 0x80, 0x18, 0x45, 0x02,
|
||||
0x42, 0x92, 0x0b, 0x42, 0xc4, 0x10, 0x32, 0x14, 0x38, 0x08, 0x18, 0x4b,
|
||||
0x0a, 0x32, 0x62, 0x88, 0x48, 0x90, 0x14, 0x20, 0x43, 0x46, 0x88, 0xa5,
|
||||
0x00, 0x19, 0x32, 0x42, 0xe4, 0x48, 0x0e, 0x90, 0x11, 0x23, 0xc4, 0x50,
|
||||
0x41, 0x51, 0x81, 0x8c, 0xe1, 0x83, 0xe5, 0x8a, 0x04, 0x31, 0x46, 0x06,
|
||||
0x51, 0x18, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x1b, 0x8c, 0xe0, 0xff,
|
||||
0xff, 0xff, 0xff, 0x07, 0x40, 0x02, 0xa8, 0x0d, 0x84, 0xf0, 0xff, 0xff,
|
||||
0xff, 0xff, 0x03, 0x20, 0x6d, 0x30, 0x86, 0xff, 0xff, 0xff, 0xff, 0x1f,
|
||||
0x00, 0x09, 0xa8, 0x00, 0x49, 0x18, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
|
||||
0x13, 0x82, 0x60, 0x42, 0x20, 0x4c, 0x08, 0x06, 0x00, 0x00, 0x00, 0x00,
|
||||
0x89, 0x20, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x32, 0x22, 0x88, 0x09,
|
||||
0x20, 0x64, 0x85, 0x04, 0x13, 0x23, 0xa4, 0x84, 0x04, 0x13, 0x23, 0xe3,
|
||||
0x84, 0xa1, 0x90, 0x14, 0x12, 0x4c, 0x8c, 0x8c, 0x0b, 0x84, 0xc4, 0x4c,
|
||||
0x10, 0x90, 0xc1, 0x08, 0x40, 0x09, 0x00, 0x0a, 0x66, 0x00, 0xe6, 0x08,
|
||||
0xc0, 0x60, 0x8e, 0x00, 0x29, 0xc6, 0x40, 0x10, 0x44, 0x41, 0x90, 0x51,
|
||||
0x0c, 0x80, 0x20, 0x88, 0x62, 0x20, 0xa4, 0x18, 0x03, 0x31, 0x0c, 0xc3,
|
||||
0x40, 0xca, 0x4d, 0xc3, 0xe5, 0x4f, 0xd8, 0x43, 0x48, 0xfe, 0x4a, 0x48,
|
||||
0x2b, 0x31, 0xf9, 0xc5, 0x6d, 0xa3, 0x62, 0x18, 0x86, 0x81, 0xa0, 0xe2,
|
||||
0x9e, 0xe1, 0xf2, 0x27, 0xec, 0x21, 0x24, 0x3f, 0x04, 0x9a, 0x61, 0x21,
|
||||
0x50, 0xd0, 0x14, 0x86, 0x21, 0x1c, 0x67, 0x18, 0x86, 0x81, 0x20, 0x88,
|
||||
0x81, 0x9e, 0x32, 0x0c, 0xc4, 0x40, 0xd1, 0x51, 0xc3, 0xe5, 0x4f, 0xd8,
|
||||
0x43, 0x48, 0x3e, 0xb7, 0x51, 0xc5, 0x4a, 0x4c, 0x7e, 0x71, 0xdb, 0x88,
|
||||
0x18, 0x86, 0x61, 0x28, 0xc4, 0x44, 0x38, 0x04, 0x51, 0x73, 0x04, 0x41,
|
||||
0x31, 0x1c, 0xa2, 0x20, 0x08, 0x8b, 0xae, 0x81, 0x80, 0x61, 0x04, 0x62,
|
||||
0x98, 0xa9, 0x0d, 0xc6, 0x81, 0x1d, 0xc2, 0x61, 0x1e, 0xe6, 0xc1, 0x0d,
|
||||
0x68, 0xa1, 0x1c, 0xf0, 0x81, 0x1e, 0xea, 0x41, 0x1e, 0xca, 0x41, 0x0e,
|
||||
0x48, 0x81, 0x0f, 0xec, 0xa1, 0x1c, 0xc6, 0x81, 0x1e, 0xde, 0x41, 0x1e,
|
||||
0xf8, 0xc0, 0x1c, 0xd8, 0xe1, 0x1d, 0xc2, 0x81, 0x1e, 0xd8, 0x00, 0x0c,
|
||||
0xe8, 0xc0, 0x0f, 0xc0, 0xc0, 0x0f, 0xf4, 0x40, 0x0f, 0xda, 0x21, 0x1d,
|
||||
0xe0, 0x61, 0x1e, 0x7e, 0x81, 0x1e, 0xf2, 0x01, 0x1e, 0xca, 0x01, 0x05,
|
||||
0xc4, 0x4c, 0x62, 0x30, 0x0e, 0xec, 0x10, 0x0e, 0xf3, 0x30, 0x0f, 0x6e,
|
||||
0x40, 0x0b, 0xe5, 0x80, 0x0f, 0xf4, 0x50, 0x0f, 0xf2, 0x50, 0x0e, 0x72,
|
||||
0x40, 0x0a, 0x7c, 0x60, 0x0f, 0xe5, 0x30, 0x0e, 0xf4, 0xf0, 0x0e, 0xf2,
|
||||
0xc0, 0x07, 0xe6, 0xc0, 0x0e, 0xef, 0x10, 0x0e, 0xf4, 0xc0, 0x06, 0x60,
|
||||
0x40, 0x07, 0x7e, 0x00, 0x06, 0x7e, 0x80, 0x04, 0x6d, 0x23, 0x6e, 0x18,
|
||||
0x41, 0x18, 0x8e, 0x99, 0xb0, 0x87, 0xf8, 0x39, 0xa7, 0x99, 0x88, 0x6b,
|
||||
0x42, 0x81, 0x47, 0xdf, 0x4d, 0xd2, 0x14, 0x51, 0xc2, 0xe4, 0xb3, 0x00,
|
||||
0xf3, 0x2c, 0x44, 0xc4, 0x4e, 0xc0, 0x44, 0xa0, 0x80, 0xa0, 0x30, 0x11,
|
||||
0x08, 0x00, 0x00, 0x00, 0x13, 0x14, 0x72, 0xc0, 0x87, 0x74, 0x60, 0x87,
|
||||
0x36, 0x68, 0x87, 0x79, 0x68, 0x03, 0x72, 0xc0, 0x87, 0x0d, 0xaf, 0x50,
|
||||
0x0e, 0x6d, 0xd0, 0x0e, 0x7a, 0x50, 0x0e, 0x6d, 0x00, 0x0f, 0x7a, 0x30,
|
||||
0x07, 0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x71, 0xa0,
|
||||
0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x78, 0xa0, 0x07, 0x73, 0x20,
|
||||
0x07, 0x6d, 0x90, 0x0e, 0x71, 0x60, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0,
|
||||
0x06, 0xe9, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90,
|
||||
0x0e, 0x76, 0x40, 0x07, 0x7a, 0x60, 0x07, 0x74, 0xd0, 0x06, 0xe6, 0x10,
|
||||
0x07, 0x76, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x60, 0x0e, 0x73, 0x20,
|
||||
0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0, 0x06, 0xe6, 0x60, 0x07, 0x74, 0xa0,
|
||||
0x07, 0x76, 0x40, 0x07, 0x6d, 0xe0, 0x0e, 0x78, 0xa0, 0x07, 0x71, 0x60,
|
||||
0x07, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x76, 0x40, 0x07, 0x43, 0x9e,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86,
|
||||
0x3c, 0x06, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x0c, 0x79, 0x10, 0x20, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x18, 0xf2, 0x28, 0x40, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x30, 0xe4, 0x79, 0x80, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x60, 0xc8, 0x13, 0x01, 0x01, 0x10, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0xc0, 0x90, 0x87, 0x02, 0x02, 0x60, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x21, 0xcf, 0x05, 0x04, 0xc0, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x59, 0x20, 0x00, 0x00, 0x00,
|
||||
0x0f, 0x00, 0x00, 0x00, 0x32, 0x1e, 0x98, 0x14, 0x19, 0x11, 0x4c, 0x90,
|
||||
0x8c, 0x09, 0x26, 0x47, 0xc6, 0x04, 0x43, 0x22, 0x4a, 0x60, 0x04, 0xa0,
|
||||
0x20, 0x8a, 0xa1, 0x08, 0x4a, 0xa2, 0x0c, 0xca, 0x83, 0x8a, 0x92, 0x18,
|
||||
0x01, 0x28, 0x82, 0x42, 0x28, 0x10, 0xea, 0x66, 0x00, 0x08, 0x9c, 0x01,
|
||||
0x20, 0x71, 0x06, 0x80, 0xc6, 0xb1, 0x10, 0x83, 0x08, 0x04, 0x02, 0x79,
|
||||
0x1e, 0x00, 0x00, 0x00, 0x79, 0x18, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00,
|
||||
0x1a, 0x03, 0x4c, 0x90, 0x46, 0x02, 0x13, 0xc4, 0x8e, 0x0c, 0x6f, 0xec,
|
||||
0xed, 0x4d, 0x0c, 0x24, 0xc6, 0x05, 0xc7, 0x45, 0xa6, 0x06, 0x46, 0xc6,
|
||||
0x05, 0x07, 0x04, 0x45, 0x8c, 0xe6, 0x26, 0x26, 0x06, 0x67, 0x26, 0xa7,
|
||||
0x2c, 0x65, 0x43, 0x10, 0x4c, 0x10, 0x08, 0x64, 0x82, 0x40, 0x24, 0x1b,
|
||||
0x84, 0x81, 0x98, 0x20, 0x10, 0xca, 0x06, 0x61, 0x30, 0x28, 0xc0, 0xcd,
|
||||
0x4d, 0x10, 0x88, 0x65, 0xc3, 0x80, 0x24, 0xc4, 0x04, 0xa1, 0xab, 0x08,
|
||||
0x4c, 0x10, 0x08, 0x66, 0x82, 0x40, 0x34, 0x1b, 0x04, 0xc2, 0xd9, 0x90,
|
||||
0x10, 0x0b, 0xd3, 0x10, 0x43, 0x43, 0x3c, 0x1b, 0x02, 0x68, 0x82, 0x00,
|
||||
0x06, 0xd6, 0x04, 0x81, 0x70, 0x36, 0x20, 0x84, 0xc4, 0x4c, 0xc4, 0x60,
|
||||
0x00, 0x1b, 0x02, 0x6a, 0x82, 0x20, 0x06, 0xd7, 0x06, 0x84, 0xb0, 0x98,
|
||||
0x86, 0x18, 0x08, 0x60, 0x43, 0x70, 0x6d, 0x20, 0x22, 0xa0, 0xc2, 0x26,
|
||||
0x08, 0x63, 0x80, 0x6d, 0x08, 0xb4, 0x09, 0x82, 0x00, 0x90, 0x68, 0x0b,
|
||||
0x4b, 0x73, 0x23, 0x42, 0x55, 0x84, 0x35, 0xf4, 0xf4, 0x24, 0x45, 0x34,
|
||||
0x41, 0x28, 0xa0, 0x09, 0x42, 0x11, 0x6d, 0x08, 0x88, 0x09, 0x42, 0x21,
|
||||
0x4d, 0x10, 0x8a, 0x69, 0x82, 0x40, 0x3c, 0x1b, 0x84, 0x89, 0x0c, 0x36,
|
||||
0x2c, 0x84, 0xf7, 0x81, 0x41, 0x18, 0x88, 0xc1, 0x30, 0x06, 0x04, 0x18,
|
||||
0x94, 0xc1, 0x86, 0x60, 0xd8, 0x20, 0x4c, 0xd3, 0x86, 0x65, 0xf0, 0x3e,
|
||||
0x30, 0x38, 0x03, 0x31, 0x18, 0xc4, 0x60, 0x00, 0x03, 0x34, 0xd8, 0x20,
|
||||
0x98, 0x41, 0x1a, 0x30, 0x99, 0xb2, 0xfa, 0xa2, 0x0a, 0x93, 0x3b, 0x2b,
|
||||
0xa3, 0x9b, 0x20, 0x14, 0xd4, 0x86, 0x85, 0x58, 0x83, 0x8f, 0x0d, 0xc2,
|
||||
0x00, 0x0c, 0x86, 0x31, 0x20, 0xc0, 0xa0, 0x0c, 0x36, 0x04, 0x6d, 0xb0,
|
||||
0x61, 0x50, 0x03, 0x37, 0x00, 0x36, 0x14, 0x5c, 0xf7, 0x06, 0x19, 0x50,
|
||||
0x85, 0x8d, 0xcd, 0xae, 0xcd, 0x25, 0x8d, 0xac, 0xcc, 0x8d, 0x6e, 0x4a,
|
||||
0x10, 0x54, 0x21, 0xc3, 0x73, 0xb1, 0x2b, 0x93, 0x9b, 0x4b, 0x7b, 0x73,
|
||||
0x9b, 0x12, 0x10, 0x4d, 0xc8, 0xf0, 0x5c, 0xec, 0xc2, 0xd8, 0xec, 0xca,
|
||||
0xe4, 0xa6, 0x04, 0x46, 0x1d, 0x32, 0x3c, 0x97, 0x39, 0xb4, 0x30, 0xb2,
|
||||
0x32, 0xb9, 0xa6, 0x37, 0xb2, 0x32, 0xb6, 0x29, 0x41, 0x52, 0x86, 0x0c,
|
||||
0xcf, 0x45, 0xae, 0x6c, 0xee, 0xad, 0x4e, 0x6e, 0xac, 0x6c, 0x6e, 0x4a,
|
||||
0x80, 0xd5, 0x21, 0xc3, 0x73, 0xb1, 0x4b, 0x2b, 0xbb, 0x4b, 0x22, 0x9b,
|
||||
0xa2, 0x0b, 0xa3, 0x2b, 0x9b, 0x12, 0x68, 0x75, 0xc8, 0xf0, 0x5c, 0xca,
|
||||
0xdc, 0xe8, 0xe4, 0xf2, 0xa0, 0xde, 0xd2, 0xdc, 0xe8, 0xe6, 0xa6, 0x04,
|
||||
0x6f, 0x00, 0x00, 0x00, 0x79, 0x18, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00,
|
||||
0x33, 0x08, 0x80, 0x1c, 0xc4, 0xe1, 0x1c, 0x66, 0x14, 0x01, 0x3d, 0x88,
|
||||
0x43, 0x38, 0x84, 0xc3, 0x8c, 0x42, 0x80, 0x07, 0x79, 0x78, 0x07, 0x73,
|
||||
0x98, 0x71, 0x0c, 0xe6, 0x00, 0x0f, 0xed, 0x10, 0x0e, 0xf4, 0x80, 0x0e,
|
||||
0x33, 0x0c, 0x42, 0x1e, 0xc2, 0xc1, 0x1d, 0xce, 0xa1, 0x1c, 0x66, 0x30,
|
||||
0x05, 0x3d, 0x88, 0x43, 0x38, 0x84, 0x83, 0x1b, 0xcc, 0x03, 0x3d, 0xc8,
|
||||
0x43, 0x3d, 0x8c, 0x03, 0x3d, 0xcc, 0x78, 0x8c, 0x74, 0x70, 0x07, 0x7b,
|
||||
0x08, 0x07, 0x79, 0x48, 0x87, 0x70, 0x70, 0x07, 0x7a, 0x70, 0x03, 0x76,
|
||||
0x78, 0x87, 0x70, 0x20, 0x87, 0x19, 0xcc, 0x11, 0x0e, 0xec, 0x90, 0x0e,
|
||||
0xe1, 0x30, 0x0f, 0x6e, 0x30, 0x0f, 0xe3, 0xf0, 0x0e, 0xf0, 0x50, 0x0e,
|
||||
0x33, 0x10, 0xc4, 0x1d, 0xde, 0x21, 0x1c, 0xd8, 0x21, 0x1d, 0xc2, 0x61,
|
||||
0x1e, 0x66, 0x30, 0x89, 0x3b, 0xbc, 0x83, 0x3b, 0xd0, 0x43, 0x39, 0xb4,
|
||||
0x03, 0x3c, 0xbc, 0x83, 0x3c, 0x84, 0x03, 0x3b, 0xcc, 0xf0, 0x14, 0x76,
|
||||
0x60, 0x07, 0x7b, 0x68, 0x07, 0x37, 0x68, 0x87, 0x72, 0x68, 0x07, 0x37,
|
||||
0x80, 0x87, 0x70, 0x90, 0x87, 0x70, 0x60, 0x07, 0x76, 0x28, 0x07, 0x76,
|
||||
0xf8, 0x05, 0x76, 0x78, 0x87, 0x77, 0x80, 0x87, 0x5f, 0x08, 0x87, 0x71,
|
||||
0x18, 0x87, 0x72, 0x98, 0x87, 0x79, 0x98, 0x81, 0x2c, 0xee, 0xf0, 0x0e,
|
||||
0xee, 0xe0, 0x0e, 0xf5, 0xc0, 0x0e, 0xec, 0x30, 0x03, 0x62, 0xc8, 0xa1,
|
||||
0x1c, 0xe4, 0xa1, 0x1c, 0xcc, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c, 0xdc, 0x61,
|
||||
0x1c, 0xca, 0x21, 0x1c, 0xc4, 0x81, 0x1d, 0xca, 0x61, 0x06, 0xd6, 0x90,
|
||||
0x43, 0x39, 0xc8, 0x43, 0x39, 0x98, 0x43, 0x39, 0xc8, 0x43, 0x39, 0xb8,
|
||||
0xc3, 0x38, 0x94, 0x43, 0x38, 0x88, 0x03, 0x3b, 0x94, 0xc3, 0x2f, 0xbc,
|
||||
0x83, 0x3c, 0xfc, 0x82, 0x3b, 0xd4, 0x03, 0x3b, 0xb0, 0xc3, 0x8c, 0xc8,
|
||||
0x21, 0x07, 0x7c, 0x70, 0x03, 0x72, 0x10, 0x87, 0x73, 0x70, 0x03, 0x7b,
|
||||
0x08, 0x07, 0x79, 0x60, 0x87, 0x70, 0xc8, 0x87, 0x77, 0xa8, 0x07, 0x7a,
|
||||
0x98, 0x81, 0x3c, 0xe4, 0x80, 0x0f, 0x6e, 0x40, 0x0f, 0xe5, 0xd0, 0x0e,
|
||||
0xf0, 0x00, 0x00, 0x00, 0x71, 0x20, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00,
|
||||
0x66, 0xb0, 0x0d, 0x97, 0xef, 0x3c, 0xbe, 0x10, 0x50, 0x45, 0x41, 0x44,
|
||||
0xa5, 0x03, 0x0c, 0x25, 0x61, 0x00, 0x02, 0xe6, 0x17, 0xb7, 0x6d, 0x07,
|
||||
0xd2, 0x70, 0xf9, 0xce, 0xe3, 0x0b, 0x11, 0x01, 0x4c, 0x44, 0x08, 0x34,
|
||||
0xc3, 0x42, 0xd8, 0x80, 0x33, 0x5c, 0xbe, 0xf3, 0xf8, 0x83, 0x33, 0xd9,
|
||||
0x7e, 0x71, 0xdb, 0x16, 0x30, 0x0d, 0x97, 0xef, 0x3c, 0xfe, 0xe2, 0x00,
|
||||
0x83, 0xd8, 0x3c, 0xd4, 0xe4, 0x17, 0xb7, 0x6d, 0x04, 0xd0, 0x70, 0xf9,
|
||||
0xce, 0xe3, 0x4b, 0x00, 0xf3, 0x2c, 0x84, 0x5f, 0xdc, 0xb6, 0x09, 0x54,
|
||||
0xc3, 0xe5, 0x3b, 0x8f, 0x2f, 0x4d, 0x4e, 0x44, 0xa0, 0xd4, 0xf4, 0x50,
|
||||
0x93, 0x5f, 0xdc, 0xb6, 0x15, 0x3c, 0xc3, 0xe5, 0x3b, 0x8f, 0x4f, 0x35,
|
||||
0x40, 0x84, 0xf9, 0xc5, 0x6d, 0x1b, 0x00, 0xc1, 0x00, 0x48, 0x03, 0x00,
|
||||
0x61, 0x20, 0x00, 0x00, 0x8f, 0x00, 0x00, 0x00, 0x13, 0x04, 0x41, 0x2c,
|
||||
0x10, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x64, 0x8d, 0x00, 0x50,
|
||||
0x51, 0x02, 0x65, 0x40, 0x44, 0xb1, 0x94, 0x46, 0xd9, 0x15, 0x5e, 0xb1,
|
||||
0x95, 0x5c, 0x29, 0x14, 0xc2, 0x0c, 0x00, 0x0d, 0x63, 0x04, 0xf6, 0xa9,
|
||||
0x82, 0xf8, 0x37, 0x46, 0xa0, 0xb3, 0xe6, 0xcc, 0x82, 0xc1, 0x18, 0x41,
|
||||
0x0d, 0xaf, 0x2f, 0xfd, 0x8d, 0x11, 0xd0, 0xf0, 0xfa, 0xdf, 0xdf, 0x18,
|
||||
0x01, 0x08, 0x82, 0x20, 0xff, 0x8d, 0x11, 0x80, 0x20, 0x08, 0x92, 0x60,
|
||||
0x30, 0x46, 0xb0, 0xd6, 0x6a, 0xad, 0x7e, 0x63, 0x04, 0x20, 0x08, 0x82,
|
||||
0xf6, 0x37, 0x46, 0x00, 0x82, 0x20, 0x08, 0x7e, 0x63, 0x04, 0xbb, 0x3f,
|
||||
0xca, 0x24, 0x18, 0x8c, 0x11, 0xb4, 0xe6, 0x9c, 0xd3, 0xde, 0x18, 0x01,
|
||||
0x08, 0x82, 0x20, 0x08, 0x0a, 0x63, 0x04, 0x20, 0x08, 0x82, 0xf8, 0x37,
|
||||
0x46, 0x00, 0x82, 0x20, 0x08, 0xff, 0xc2, 0x0c, 0x00, 0x00, 0x00, 0x00,
|
||||
0x23, 0x06, 0x09, 0x00, 0x82, 0x60, 0x70, 0xb5, 0xc1, 0x34, 0x06, 0x6b,
|
||||
0xb0, 0x06, 0xdb, 0x88, 0x41, 0x02, 0x80, 0x20, 0x18, 0x5c, 0x6e, 0x40,
|
||||
0x69, 0x6c, 0xc0, 0x06, 0xdc, 0x88, 0x41, 0x02, 0x80, 0x20, 0x18, 0x5c,
|
||||
0x6f, 0x50, 0x91, 0x41, 0x1b, 0xb4, 0x41, 0x37, 0x62, 0x90, 0x00, 0x20,
|
||||
0x08, 0x06, 0x86, 0x1d, 0x50, 0x6f, 0xe0, 0x06, 0x66, 0x30, 0x8d, 0x18,
|
||||
0x24, 0x00, 0x08, 0x82, 0x81, 0x71, 0x07, 0x15, 0x1c, 0xbc, 0x81, 0x47,
|
||||
0x8d, 0x18, 0x24, 0x00, 0x08, 0x82, 0x81, 0x81, 0x07, 0x16, 0x1c, 0xc0,
|
||||
0x01, 0x1a, 0x54, 0x23, 0x06, 0x09, 0x00, 0x82, 0x60, 0x60, 0xe4, 0xc1,
|
||||
0x15, 0x07, 0x71, 0x00, 0x06, 0xd6, 0x88, 0x41, 0x02, 0x80, 0x20, 0x18,
|
||||
0x18, 0x7a, 0x80, 0xc9, 0x81, 0x1c, 0xa4, 0xc1, 0x35, 0x62, 0x90, 0x00,
|
||||
0x20, 0x08, 0x06, 0xc6, 0x1e, 0x64, 0x73, 0x30, 0x07, 0x61, 0x80, 0x99,
|
||||
0xb1, 0xc0, 0xc7, 0x0c, 0x06, 0x3e, 0x23, 0x06, 0x09, 0x00, 0x82, 0x60,
|
||||
0xa0, 0xf0, 0xc1, 0x27, 0x04, 0x42, 0x60, 0x41, 0x24, 0x1f, 0x0b, 0x08,
|
||||
0xf9, 0x98, 0x40, 0xc8, 0xc7, 0x04, 0x06, 0x3e, 0x26, 0x30, 0xf0, 0x19,
|
||||
0x31, 0x78, 0x00, 0x10, 0x04, 0x83, 0x27, 0x14, 0xcc, 0x20, 0x82, 0x9c,
|
||||
0x46, 0x92, 0xf8, 0x80, 0x0f, 0xc2, 0x40, 0x1a, 0x4d, 0x08, 0x80, 0xd1,
|
||||
0x04, 0x21, 0x18, 0x4d, 0x18, 0x84, 0xd1, 0x04, 0x62, 0xb0, 0xc0, 0x91,
|
||||
0x8f, 0x69, 0x48, 0x7c, 0x6c, 0x43, 0xe2, 0x33, 0x62, 0x70, 0x00, 0x20,
|
||||
0x08, 0x06, 0xd4, 0x29, 0xbc, 0xc1, 0x45, 0x0a, 0xa3, 0x09, 0x41, 0x60,
|
||||
0x4b, 0x18, 0xc8, 0xc7, 0x02, 0x41, 0x3e, 0x23, 0x06, 0x06, 0x00, 0x82,
|
||||
0x60, 0x10, 0xb1, 0x02, 0x1d, 0x04, 0x16, 0x94, 0x81, 0x7c, 0x2c, 0x38,
|
||||
0x03, 0xf8, 0x8c, 0x26, 0x1c, 0x80, 0x49, 0x6a, 0x20, 0x1f, 0x0b, 0x04,
|
||||
0xf9, 0xd8, 0x19, 0x04, 0xf1, 0x19, 0x8e, 0x10, 0x82, 0xe1, 0x1b, 0x31,
|
||||
0x30, 0x00, 0x10, 0x04, 0x83, 0x88, 0x16, 0x5c, 0x61, 0x18, 0x31, 0x30,
|
||||
0x00, 0x10, 0x04, 0x83, 0xa8, 0x16, 0xfc, 0x20, 0xb0, 0x35, 0x08, 0xe2,
|
||||
0x33, 0xdd, 0x20, 0x04, 0x84, 0x05, 0x73, 0x20, 0x9f, 0xe1, 0x88, 0xa0,
|
||||
0x0e, 0x88, 0x6f, 0xba, 0xe1, 0x0e, 0xf4, 0x20, 0xb0, 0x4e, 0x0f, 0xe4,
|
||||
0x63, 0x41, 0x27, 0x1f, 0x0b, 0x2e, 0xf9, 0x58, 0x70, 0xc9, 0xc7, 0x82,
|
||||
0x3e, 0x80, 0x8f, 0x49, 0x81, 0x7c, 0x2c, 0x38, 0xe4, 0x63, 0x61, 0xe0,
|
||||
0x06, 0xf2, 0xb1, 0x40, 0x90, 0x8f, 0x89, 0xc1, 0x1b, 0xc8, 0xc7, 0x02,
|
||||
0x42, 0x3e, 0x36, 0x06, 0x70, 0x20, 0x1f, 0x0b, 0x0c, 0xf9, 0x8c, 0x18,
|
||||
0x24, 0x00, 0x08, 0x82, 0x01, 0xb2, 0x0e, 0xab, 0x40, 0x0e, 0xe4, 0xc0,
|
||||
0x0b, 0xc5, 0x88, 0x41, 0x02, 0x80, 0x20, 0x18, 0x20, 0xeb, 0xb0, 0x0a,
|
||||
0xe4, 0x40, 0x0e, 0xb3, 0x30, 0x8c, 0x18, 0x24, 0x00, 0x08, 0x82, 0x01,
|
||||
0xb2, 0x0e, 0xab, 0x40, 0x0e, 0xe4, 0xb0, 0x0b, 0xc1, 0x88, 0x41, 0x02,
|
||||
0x80, 0x20, 0x18, 0x20, 0xeb, 0xb0, 0x0a, 0xe4, 0x40, 0x0e, 0xb2, 0x30,
|
||||
0x06, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
static const unsigned int testgpu_effects_CRT_frag_dxil_len = 4664;
|
||||
@@ -0,0 +1,56 @@
|
||||
// This shader is adapted from the Lightweight CRT Effect at:
|
||||
// https://godotshaders.com/shader/lightweight-crt-effect/
|
||||
|
||||
cbuffer Context : register(b0, space3) {
|
||||
float2 resolution;
|
||||
};
|
||||
|
||||
Texture2D u_texture : register(t0, space2);
|
||||
SamplerState u_sampler : register(s0, space2);
|
||||
|
||||
struct PSInput {
|
||||
float4 v_color : COLOR0;
|
||||
float2 v_uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct PSOutput {
|
||||
float4 o_color : SV_Target;
|
||||
};
|
||||
|
||||
static const float PI = 3.14159265f;
|
||||
|
||||
// These could be turned into uniforms if you wanted to tweak them
|
||||
static const float scan_line_amount = 0.5; // Range 0-1
|
||||
static const float warp_amount = 0.05; // Range 0-1
|
||||
static const float vignette_amount = 0.5; // Range 0-1
|
||||
static const float vignette_intensity = 0.3; // Range 0-1
|
||||
static const float grille_amount = 0.05; // Range 0-1
|
||||
static const float brightness_boost = 1.2; // Range 1-2
|
||||
|
||||
PSOutput main(PSInput input) {
|
||||
PSOutput output;
|
||||
|
||||
float2 uv = input.v_uv;
|
||||
|
||||
float2 delta = uv - 0.5;
|
||||
float warp_factor = dot(delta, delta) * warp_amount;
|
||||
uv += delta * warp_factor;
|
||||
|
||||
float scanline = sin(uv.y * resolution.y * PI) * 0.5 + 0.5;
|
||||
scanline = lerp(1.0, scanline, scan_line_amount * 0.5);
|
||||
|
||||
float grille = fmod(uv.x * resolution.x, 3.0) < 1.5 ? 0.95 : 1.05;
|
||||
grille = lerp(1.0, grille, grille_amount * 0.5);
|
||||
|
||||
float4 color = u_texture.Sample(u_sampler, input.v_uv) * input.v_color;
|
||||
color.rgb *= scanline * grille;
|
||||
|
||||
float2 v_uv = uv * (1.0 - uv.xy);
|
||||
float vignette = v_uv.x * v_uv.y * 15.0;
|
||||
vignette = lerp(1.0, vignette, vignette_amount * 0.7);
|
||||
|
||||
color.rgb *= vignette * brightness_boost;
|
||||
|
||||
output.o_color = color;
|
||||
return output;
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
static const unsigned char testgpu_effects_CRT_frag_msl[] = {
|
||||
0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65,
|
||||
0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x3e, 0x0a,
|
||||
0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x73, 0x69,
|
||||
0x6d, 0x64, 0x2f, 0x73, 0x69, 0x6d, 0x64, 0x2e, 0x68, 0x3e, 0x0a, 0x0a,
|
||||
0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70,
|
||||
0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x0a,
|
||||
0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x74, 0x79, 0x70, 0x65, 0x5f,
|
||||
0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x0a, 0x7b, 0x0a, 0x20, 0x20,
|
||||
0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x72, 0x65, 0x73,
|
||||
0x6f, 0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a,
|
||||
0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x6d, 0x61, 0x69, 0x6e,
|
||||
0x30, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20,
|
||||
0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x6f, 0x75, 0x74, 0x5f, 0x76,
|
||||
0x61, 0x72, 0x5f, 0x53, 0x56, 0x5f, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74,
|
||||
0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x30, 0x29, 0x5d,
|
||||
0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63,
|
||||
0x74, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x30, 0x5f, 0x69, 0x6e, 0x0a, 0x7b,
|
||||
0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20,
|
||||
0x69, 0x6e, 0x5f, 0x76, 0x61, 0x72, 0x5f, 0x43, 0x4f, 0x4c, 0x4f, 0x52,
|
||||
0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63,
|
||||
0x6e, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66,
|
||||
0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x69, 0x6e, 0x5f, 0x76, 0x61, 0x72,
|
||||
0x5f, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x30, 0x20, 0x5b,
|
||||
0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, 0x31, 0x29,
|
||||
0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x66, 0x72, 0x61, 0x67,
|
||||
0x6d, 0x65, 0x6e, 0x74, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x30, 0x5f, 0x6f,
|
||||
0x75, 0x74, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x30, 0x28, 0x6d, 0x61, 0x69,
|
||||
0x6e, 0x30, 0x5f, 0x69, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x5b, 0x5b, 0x73,
|
||||
0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63,
|
||||
0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x74, 0x79, 0x70, 0x65,
|
||||
0x5f, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x26, 0x20, 0x43, 0x6f,
|
||||
0x6e, 0x74, 0x65, 0x78, 0x74, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66,
|
||||
0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x74, 0x65, 0x78,
|
||||
0x74, 0x75, 0x72, 0x65, 0x32, 0x64, 0x3c, 0x66, 0x6c, 0x6f, 0x61, 0x74,
|
||||
0x3e, 0x20, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x20,
|
||||
0x5b, 0x5b, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x28, 0x30, 0x29,
|
||||
0x5d, 0x5d, 0x2c, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x20,
|
||||
0x75, 0x5f, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x20, 0x5b, 0x5b,
|
||||
0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d,
|
||||
0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x61, 0x69, 0x6e,
|
||||
0x30, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x3d, 0x20,
|
||||
0x7b, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61,
|
||||
0x74, 0x32, 0x20, 0x5f, 0x34, 0x39, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x2e,
|
||||
0x69, 0x6e, 0x5f, 0x76, 0x61, 0x72, 0x5f, 0x54, 0x45, 0x58, 0x43, 0x4f,
|
||||
0x4f, 0x52, 0x44, 0x30, 0x20, 0x2d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74,
|
||||
0x32, 0x28, 0x30, 0x2e, 0x35, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20,
|
||||
0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x5f, 0x35, 0x33, 0x20, 0x3d,
|
||||
0x20, 0x69, 0x6e, 0x2e, 0x69, 0x6e, 0x5f, 0x76, 0x61, 0x72, 0x5f, 0x54,
|
||||
0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x30, 0x20, 0x2b, 0x20, 0x28,
|
||||
0x5f, 0x34, 0x39, 0x20, 0x2a, 0x20, 0x28, 0x64, 0x6f, 0x74, 0x28, 0x5f,
|
||||
0x34, 0x39, 0x2c, 0x20, 0x5f, 0x34, 0x39, 0x29, 0x20, 0x2a, 0x20, 0x30,
|
||||
0x2e, 0x30, 0x35, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x37, 0x34,
|
||||
0x35, 0x30, 0x35, 0x38, 0x30, 0x35, 0x39, 0x36, 0x39, 0x32, 0x33, 0x38,
|
||||
0x32, 0x38, 0x31, 0x32, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20,
|
||||
0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x37, 0x35, 0x20,
|
||||
0x3d, 0x20, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x2e,
|
||||
0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x75, 0x5f, 0x73, 0x61, 0x6d,
|
||||
0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x69, 0x6e, 0x2e, 0x69, 0x6e, 0x5f,
|
||||
0x76, 0x61, 0x72, 0x5f, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44,
|
||||
0x30, 0x29, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, 0x69, 0x6e, 0x5f, 0x76,
|
||||
0x61, 0x72, 0x5f, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x30, 0x3b, 0x0a, 0x20,
|
||||
0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x5f, 0x38,
|
||||
0x30, 0x20, 0x3d, 0x20, 0x5f, 0x35, 0x33, 0x20, 0x2a, 0x20, 0x28, 0x66,
|
||||
0x6c, 0x6f, 0x61, 0x74, 0x32, 0x28, 0x31, 0x2e, 0x30, 0x29, 0x20, 0x2d,
|
||||
0x20, 0x5f, 0x35, 0x33, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66,
|
||||
0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x5f, 0x38, 0x38, 0x20, 0x3d, 0x20,
|
||||
0x28, 0x5f, 0x37, 0x35, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x2a, 0x20, 0x28,
|
||||
0x6d, 0x69, 0x78, 0x28, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x28, 0x73, 0x69,
|
||||
0x6e, 0x28, 0x28, 0x5f, 0x35, 0x33, 0x2e, 0x79, 0x20, 0x2a, 0x20, 0x43,
|
||||
0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x6c,
|
||||
0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x79, 0x29, 0x20, 0x2a, 0x20, 0x33,
|
||||
0x2e, 0x31, 0x34, 0x31, 0x35, 0x39, 0x32, 0x37, 0x34, 0x31, 0x30, 0x31,
|
||||
0x32, 0x35, 0x37, 0x33, 0x32, 0x34, 0x32, 0x31, 0x38, 0x37, 0x35, 0x29,
|
||||
0x20, 0x2a, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x20, 0x2b, 0x20, 0x30, 0x2e,
|
||||
0x35, 0x2c, 0x20, 0x30, 0x2e, 0x32, 0x35, 0x29, 0x20, 0x2a, 0x20, 0x6d,
|
||||
0x69, 0x78, 0x28, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x28, 0x66, 0x6d, 0x6f,
|
||||
0x64, 0x28, 0x5f, 0x35, 0x33, 0x2e, 0x78, 0x20, 0x2a, 0x20, 0x43, 0x6f,
|
||||
0x6e, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x75,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x78, 0x2c, 0x20, 0x33, 0x2e, 0x30, 0x29,
|
||||
0x20, 0x3c, 0x20, 0x31, 0x2e, 0x35, 0x29, 0x20, 0x3f, 0x20, 0x30, 0x2e,
|
||||
0x39, 0x34, 0x39, 0x39, 0x39, 0x39, 0x39, 0x38, 0x38, 0x30, 0x37, 0x39,
|
||||
0x30, 0x37, 0x31, 0x30, 0x34, 0x34, 0x39, 0x32, 0x31, 0x38, 0x37, 0x35,
|
||||
0x20, 0x3a, 0x20, 0x31, 0x2e, 0x30, 0x34, 0x39, 0x39, 0x39, 0x39, 0x39,
|
||||
0x35, 0x32, 0x33, 0x31, 0x36, 0x32, 0x38, 0x34, 0x31, 0x37, 0x39, 0x36,
|
||||
0x38, 0x37, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x32, 0x35, 0x30, 0x30,
|
||||
0x30, 0x30, 0x30, 0x30, 0x33, 0x37, 0x32, 0x35, 0x32, 0x39, 0x30, 0x32,
|
||||
0x39, 0x38, 0x34, 0x36, 0x31, 0x39, 0x31, 0x34, 0x30, 0x36, 0x32, 0x35,
|
||||
0x29, 0x29, 0x29, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x2a, 0x20, 0x28, 0x6d,
|
||||
0x69, 0x78, 0x28, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x28, 0x5f, 0x38, 0x30,
|
||||
0x2e, 0x78, 0x20, 0x2a, 0x20, 0x5f, 0x38, 0x30, 0x2e, 0x79, 0x29, 0x20,
|
||||
0x2a, 0x20, 0x31, 0x35, 0x2e, 0x30, 0x2c, 0x20, 0x30, 0x2e, 0x33, 0x34,
|
||||
0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x34, 0x30, 0x33, 0x39, 0x35, 0x33,
|
||||
0x35, 0x35, 0x32, 0x32, 0x34, 0x36, 0x30, 0x39, 0x33, 0x37, 0x35, 0x29,
|
||||
0x20, 0x2a, 0x20, 0x31, 0x2e, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
|
||||
0x34, 0x37, 0x36, 0x38, 0x33, 0x37, 0x31, 0x35, 0x38, 0x32, 0x30, 0x33,
|
||||
0x31, 0x32, 0x35, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75,
|
||||
0x74, 0x2e, 0x6f, 0x75, 0x74, 0x5f, 0x76, 0x61, 0x72, 0x5f, 0x53, 0x56,
|
||||
0x5f, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x20, 0x3d, 0x20, 0x66, 0x6c,
|
||||
0x6f, 0x61, 0x74, 0x34, 0x28, 0x5f, 0x38, 0x38, 0x2e, 0x78, 0x2c, 0x20,
|
||||
0x5f, 0x38, 0x38, 0x2e, 0x79, 0x2c, 0x20, 0x5f, 0x38, 0x38, 0x2e, 0x7a,
|
||||
0x2c, 0x20, 0x5f, 0x37, 0x35, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20,
|
||||
0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74,
|
||||
0x3b, 0x0a, 0x7d, 0x0a, 0x0a
|
||||
};
|
||||
static const unsigned int testgpu_effects_CRT_frag_msl_len = 1229;
|
||||
@@ -0,0 +1,189 @@
|
||||
static const unsigned char testgpu_effects_CRT_frag_spv[] = {
|
||||
0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0e, 0x00,
|
||||
0x5a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30,
|
||||
0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
|
||||
0x10, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0x58, 0x02, 0x00, 0x00,
|
||||
0x05, 0x00, 0x06, 0x00, 0x06, 0x00, 0x00, 0x00, 0x74, 0x79, 0x70, 0x65,
|
||||
0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x00, 0x00, 0x00, 0x00,
|
||||
0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x72, 0x65, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x00,
|
||||
0x05, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x43, 0x6f, 0x6e, 0x74,
|
||||
0x65, 0x78, 0x74, 0x00, 0x05, 0x00, 0x06, 0x00, 0x08, 0x00, 0x00, 0x00,
|
||||
0x74, 0x79, 0x70, 0x65, 0x2e, 0x32, 0x64, 0x2e, 0x69, 0x6d, 0x61, 0x67,
|
||||
0x65, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x09, 0x00, 0x00, 0x00,
|
||||
0x75, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x00,
|
||||
0x05, 0x00, 0x06, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x74, 0x79, 0x70, 0x65,
|
||||
0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00, 0x00,
|
||||
0x05, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x73, 0x61,
|
||||
0x6d, 0x70, 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x69, 0x6e, 0x2e, 0x76, 0x61, 0x72, 0x2e, 0x43,
|
||||
0x4f, 0x4c, 0x4f, 0x52, 0x30, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00,
|
||||
0x04, 0x00, 0x00, 0x00, 0x69, 0x6e, 0x2e, 0x76, 0x61, 0x72, 0x2e, 0x54,
|
||||
0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x30, 0x00, 0x00, 0x00, 0x00,
|
||||
0x05, 0x00, 0x07, 0x00, 0x05, 0x00, 0x00, 0x00, 0x6f, 0x75, 0x74, 0x2e,
|
||||
0x76, 0x61, 0x72, 0x2e, 0x53, 0x56, 0x5f, 0x54, 0x61, 0x72, 0x67, 0x65,
|
||||
0x74, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00,
|
||||
0x0c, 0x00, 0x00, 0x00, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x73, 0x61, 0x6d,
|
||||
0x70, 0x6c, 0x65, 0x64, 0x2e, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x00, 0x00,
|
||||
0x47, 0x00, 0x04, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00,
|
||||
0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
|
||||
0x05, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x47, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00,
|
||||
0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
|
||||
0x09, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x47, 0x00, 0x04, 0x00, 0x09, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00,
|
||||
0x22, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
|
||||
0x0b, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x48, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00,
|
||||
0x06, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00,
|
||||
0x0d, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00,
|
||||
0x0d, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xdb, 0x0f, 0x49, 0x40,
|
||||
0x2b, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00,
|
||||
0x10, 0x00, 0x00, 0x00, 0xcd, 0xcc, 0x4c, 0x3d, 0x2b, 0x00, 0x04, 0x00,
|
||||
0x0d, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x9a, 0x99, 0x99, 0x3f,
|
||||
0x15, 0x00, 0x04, 0x00, 0x12, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x12, 0x00, 0x00, 0x00,
|
||||
0x13, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00,
|
||||
0x14, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x2c, 0x00, 0x05, 0x00, 0x14, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00,
|
||||
0x0f, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00,
|
||||
0x12, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x2b, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x80, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00,
|
||||
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x2b, 0x00, 0x04, 0x00,
|
||||
0x0d, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x3f,
|
||||
0x2b, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00,
|
||||
0x33, 0x33, 0x73, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00,
|
||||
0x1b, 0x00, 0x00, 0x00, 0x66, 0x66, 0x86, 0x3f, 0x2c, 0x00, 0x05, 0x00,
|
||||
0x14, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00,
|
||||
0x17, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00,
|
||||
0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x41, 0x1e, 0x00, 0x03, 0x00,
|
||||
0x06, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
|
||||
0x1e, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
|
||||
0x19, 0x00, 0x09, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x20, 0x00, 0x04, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x08, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x0a, 0x00, 0x00, 0x00,
|
||||
0x20, 0x00, 0x04, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x0a, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x21, 0x00, 0x00, 0x00,
|
||||
0x0d, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
|
||||
0x22, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00,
|
||||
0x20, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x14, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x24, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00,
|
||||
0x25, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x26, 0x00, 0x00, 0x00,
|
||||
0x25, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x27, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, 0x00,
|
||||
0x28, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x03, 0x00, 0x0c, 0x00, 0x00, 0x00,
|
||||
0x08, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, 0x00,
|
||||
0x0d, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00,
|
||||
0x1e, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x3b, 0x00, 0x04, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x20, 0x00, 0x00, 0x00,
|
||||
0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00,
|
||||
0x22, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x3b, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x24, 0x00, 0x00, 0x00,
|
||||
0x05, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00,
|
||||
0x0d, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3e,
|
||||
0x2b, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00,
|
||||
0xcd, 0xcc, 0xcc, 0x3c, 0x2b, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00,
|
||||
0x2c, 0x00, 0x00, 0x00, 0x33, 0x33, 0xb3, 0x3e, 0x2e, 0x00, 0x03, 0x00,
|
||||
0x21, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00,
|
||||
0x25, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x26, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x2e, 0x00, 0x00, 0x00,
|
||||
0x3d, 0x00, 0x04, 0x00, 0x21, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x14, 0x00, 0x00, 0x00,
|
||||
0x30, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00,
|
||||
0x14, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00,
|
||||
0x15, 0x00, 0x00, 0x00, 0x94, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00,
|
||||
0x32, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00,
|
||||
0x85, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00,
|
||||
0x32, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00,
|
||||
0x14, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00,
|
||||
0x33, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x14, 0x00, 0x00, 0x00,
|
||||
0x35, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
|
||||
0x51, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00,
|
||||
0x35, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00,
|
||||
0x27, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
|
||||
0x16, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00,
|
||||
0x0d, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00,
|
||||
0x85, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00,
|
||||
0x36, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00,
|
||||
0x0d, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00,
|
||||
0x0e, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x0d, 0x00, 0x00, 0x00,
|
||||
0x3b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00,
|
||||
0x3a, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00,
|
||||
0x3c, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00,
|
||||
0x81, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00,
|
||||
0x3c, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00,
|
||||
0x0d, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x2e, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00,
|
||||
0x2a, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00,
|
||||
0x3f, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x41, 0x00, 0x06, 0x00, 0x27, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
|
||||
0x07, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00,
|
||||
0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00,
|
||||
0x40, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00,
|
||||
0x42, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00,
|
||||
0x8c, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00,
|
||||
0x42, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x05, 0x00,
|
||||
0x28, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00,
|
||||
0x19, 0x00, 0x00, 0x00, 0xa9, 0x00, 0x06, 0x00, 0x0d, 0x00, 0x00, 0x00,
|
||||
0x45, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00,
|
||||
0x1b, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x0d, 0x00, 0x00, 0x00,
|
||||
0x46, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00,
|
||||
0x17, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00,
|
||||
0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00,
|
||||
0x09, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0a, 0x00, 0x00, 0x00,
|
||||
0x48, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00,
|
||||
0x0c, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00,
|
||||
0x48, 0x00, 0x00, 0x00, 0x57, 0x00, 0x06, 0x00, 0x21, 0x00, 0x00, 0x00,
|
||||
0x4a, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x21, 0x00, 0x00, 0x00,
|
||||
0x4b, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00,
|
||||
0x85, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00,
|
||||
0x3e, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00,
|
||||
0x29, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00,
|
||||
0x4b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x29, 0x00, 0x00, 0x00,
|
||||
0x4e, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00,
|
||||
0x83, 0x00, 0x05, 0x00, 0x14, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00,
|
||||
0x1c, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00,
|
||||
0x14, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00,
|
||||
0x4f, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00,
|
||||
0x51, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x51, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00,
|
||||
0x50, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00,
|
||||
0x0d, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00,
|
||||
0x52, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00,
|
||||
0x54, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00,
|
||||
0x0c, 0x00, 0x08, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00,
|
||||
0x54, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00,
|
||||
0x0d, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00,
|
||||
0x11, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x29, 0x00, 0x00, 0x00,
|
||||
0x57, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x8e, 0x00, 0x05, 0x00, 0x29, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00,
|
||||
0x57, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x09, 0x00,
|
||||
0x21, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00,
|
||||
0x58, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
|
||||
0x06, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00,
|
||||
0x05, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00,
|
||||
0x38, 0x00, 0x01, 0x00
|
||||
};
|
||||
static const unsigned int testgpu_effects_CRT_frag_spv_len = 2224;
|
||||
@@ -0,0 +1,328 @@
|
||||
static const unsigned char testgpu_effects_grayscale_frag_dxil[] = {
|
||||
0x44, 0x58, 0x42, 0x43, 0x29, 0xf5, 0x99, 0x97, 0x2a, 0xac, 0xde, 0x59,
|
||||
0xf3, 0x00, 0x55, 0x1d, 0x65, 0x99, 0x31, 0x2a, 0x01, 0x00, 0x00, 0x00,
|
||||
0x3c, 0x0f, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00,
|
||||
0x4c, 0x00, 0x00, 0x00, 0xa8, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00,
|
||||
0xd8, 0x01, 0x00, 0x00, 0x44, 0x08, 0x00, 0x00, 0x60, 0x08, 0x00, 0x00,
|
||||
0x53, 0x46, 0x49, 0x30, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x31, 0x54, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0b, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0x00, 0x00, 0x00,
|
||||
0x4f, 0x53, 0x47, 0x31, 0x34, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x53, 0x56, 0x5f, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x00, 0x00, 0x00,
|
||||
0x50, 0x53, 0x56, 0x30, 0xec, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
|
||||
0x00, 0x00, 0x00, 0x00, 0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x13, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x18, 0x00, 0x00, 0x00, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52,
|
||||
0x44, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0x6d,
|
||||
0x61, 0x69, 0x6e, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x44, 0x00, 0x03, 0x02, 0x00, 0x00,
|
||||
0x0a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x42, 0x00,
|
||||
0x03, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x44, 0x10, 0x03, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
|
||||
0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
|
||||
0x0f, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x53, 0x54, 0x41, 0x54, 0x64, 0x06, 0x00, 0x00,
|
||||
0x60, 0x00, 0x00, 0x00, 0x99, 0x01, 0x00, 0x00, 0x44, 0x58, 0x49, 0x4c,
|
||||
0x00, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x4c, 0x06, 0x00, 0x00,
|
||||
0x42, 0x43, 0xc0, 0xde, 0x21, 0x0c, 0x00, 0x00, 0x90, 0x01, 0x00, 0x00,
|
||||
0x0b, 0x82, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00,
|
||||
0x07, 0x81, 0x23, 0x91, 0x41, 0xc8, 0x04, 0x49, 0x06, 0x10, 0x32, 0x39,
|
||||
0x92, 0x01, 0x84, 0x0c, 0x25, 0x05, 0x08, 0x19, 0x1e, 0x04, 0x8b, 0x62,
|
||||
0x80, 0x14, 0x45, 0x02, 0x42, 0x92, 0x0b, 0x42, 0xa4, 0x10, 0x32, 0x14,
|
||||
0x38, 0x08, 0x18, 0x4b, 0x0a, 0x32, 0x52, 0x88, 0x48, 0x90, 0x14, 0x20,
|
||||
0x43, 0x46, 0x88, 0xa5, 0x00, 0x19, 0x32, 0x42, 0xe4, 0x48, 0x0e, 0x90,
|
||||
0x91, 0x22, 0xc4, 0x50, 0x41, 0x51, 0x81, 0x8c, 0xe1, 0x83, 0xe5, 0x8a,
|
||||
0x04, 0x29, 0x46, 0x06, 0x51, 0x18, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
|
||||
0x1b, 0x8c, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x40, 0x02, 0xa8, 0x0d,
|
||||
0x84, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x20, 0x6d, 0x30, 0x86, 0xff,
|
||||
0xff, 0xff, 0xff, 0x1f, 0x00, 0x09, 0xa8, 0x00, 0x49, 0x18, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x13, 0x82, 0x60, 0x42, 0x20, 0x4c, 0x08, 0x06,
|
||||
0x00, 0x00, 0x00, 0x00, 0x89, 0x20, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00,
|
||||
0x32, 0x22, 0x48, 0x09, 0x20, 0x64, 0x85, 0x04, 0x93, 0x22, 0xa4, 0x84,
|
||||
0x04, 0x93, 0x22, 0xe3, 0x84, 0xa1, 0x90, 0x14, 0x12, 0x4c, 0x8a, 0x8c,
|
||||
0x0b, 0x84, 0xa4, 0x4c, 0x10, 0x68, 0x23, 0x00, 0x25, 0x00, 0x14, 0x66,
|
||||
0x00, 0xe6, 0x08, 0xc0, 0x60, 0x8e, 0x00, 0x29, 0xc6, 0x20, 0x84, 0x14,
|
||||
0x42, 0xa6, 0x18, 0x80, 0x10, 0x52, 0x06, 0xa1, 0x9b, 0x86, 0xcb, 0x9f,
|
||||
0xb0, 0x87, 0x90, 0xfc, 0x95, 0x90, 0x56, 0x62, 0xf2, 0x8b, 0xdb, 0x46,
|
||||
0xc5, 0x18, 0x63, 0x10, 0x2a, 0xf7, 0x0c, 0x97, 0x3f, 0x61, 0x0f, 0x21,
|
||||
0xf9, 0x21, 0xd0, 0x0c, 0x0b, 0x81, 0x82, 0x55, 0x18, 0x45, 0x18, 0x1b,
|
||||
0x63, 0x0c, 0x42, 0xc8, 0xa0, 0x36, 0x47, 0x10, 0x14, 0x83, 0x91, 0x42,
|
||||
0xc8, 0x23, 0x38, 0x10, 0x30, 0x8c, 0x40, 0x0c, 0x33, 0xb5, 0xc1, 0x38,
|
||||
0xb0, 0x43, 0x38, 0xcc, 0xc3, 0x3c, 0xb8, 0x01, 0x2d, 0x94, 0x03, 0x3e,
|
||||
0xd0, 0x43, 0x3d, 0xc8, 0x43, 0x39, 0xc8, 0x01, 0x29, 0xf0, 0x81, 0x3d,
|
||||
0x94, 0xc3, 0x38, 0xd0, 0xc3, 0x3b, 0xc8, 0x03, 0x1f, 0x98, 0x03, 0x3b,
|
||||
0xbc, 0x43, 0x38, 0xd0, 0x03, 0x1b, 0x80, 0x01, 0x1d, 0xf8, 0x01, 0x18,
|
||||
0xf8, 0x81, 0x1e, 0xe8, 0x41, 0x3b, 0xa4, 0x03, 0x3c, 0xcc, 0xc3, 0x2f,
|
||||
0xd0, 0x43, 0x3e, 0xc0, 0x43, 0x39, 0xa0, 0x80, 0xcc, 0x24, 0x06, 0xe3,
|
||||
0xc0, 0x0e, 0xe1, 0x30, 0x0f, 0xf3, 0xe0, 0x06, 0xb4, 0x50, 0x0e, 0xf8,
|
||||
0x40, 0x0f, 0xf5, 0x20, 0x0f, 0xe5, 0x20, 0x07, 0xa4, 0xc0, 0x07, 0xf6,
|
||||
0x50, 0x0e, 0xe3, 0x40, 0x0f, 0xef, 0x20, 0x0f, 0x7c, 0x60, 0x0e, 0xec,
|
||||
0xf0, 0x0e, 0xe1, 0x40, 0x0f, 0x6c, 0x00, 0x06, 0x74, 0xe0, 0x07, 0x60,
|
||||
0xe0, 0x07, 0x48, 0x98, 0x94, 0xea, 0x4d, 0xd2, 0x14, 0x51, 0xc2, 0xe4,
|
||||
0xb3, 0x00, 0xf3, 0x2c, 0x44, 0xc4, 0x4e, 0xc0, 0x44, 0xa0, 0x80, 0xd0,
|
||||
0x4d, 0x04, 0x02, 0x00, 0x13, 0x14, 0x72, 0xc0, 0x87, 0x74, 0x60, 0x87,
|
||||
0x36, 0x68, 0x87, 0x79, 0x68, 0x03, 0x72, 0xc0, 0x87, 0x0d, 0xaf, 0x50,
|
||||
0x0e, 0x6d, 0xd0, 0x0e, 0x7a, 0x50, 0x0e, 0x6d, 0x00, 0x0f, 0x7a, 0x30,
|
||||
0x07, 0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x71, 0xa0,
|
||||
0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x78, 0xa0, 0x07, 0x73, 0x20,
|
||||
0x07, 0x6d, 0x90, 0x0e, 0x71, 0x60, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0,
|
||||
0x06, 0xe9, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90,
|
||||
0x0e, 0x76, 0x40, 0x07, 0x7a, 0x60, 0x07, 0x74, 0xd0, 0x06, 0xe6, 0x10,
|
||||
0x07, 0x76, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x60, 0x0e, 0x73, 0x20,
|
||||
0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0, 0x06, 0xe6, 0x60, 0x07, 0x74, 0xa0,
|
||||
0x07, 0x76, 0x40, 0x07, 0x6d, 0xe0, 0x0e, 0x78, 0xa0, 0x07, 0x71, 0x60,
|
||||
0x07, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x76, 0x40, 0x07, 0x43, 0x9e,
|
||||
0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86,
|
||||
0x3c, 0x06, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x0c, 0x79, 0x10, 0x20, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x18, 0xf2, 0x34, 0x40, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x30, 0xe4, 0x81, 0x80, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x20, 0x0b, 0x04, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00,
|
||||
0x32, 0x1e, 0x98, 0x14, 0x19, 0x11, 0x4c, 0x90, 0x8c, 0x09, 0x26, 0x47,
|
||||
0xc6, 0x04, 0x43, 0x22, 0x25, 0x30, 0x02, 0x50, 0x0c, 0x45, 0x50, 0x12,
|
||||
0x65, 0x50, 0x16, 0xe5, 0x51, 0x2c, 0xa5, 0x50, 0x08, 0x54, 0x4a, 0x62,
|
||||
0x04, 0xa0, 0x08, 0x0a, 0xa1, 0x40, 0xc8, 0xce, 0x00, 0x10, 0x9e, 0x01,
|
||||
0xa0, 0x3c, 0x16, 0x62, 0x10, 0xc7, 0x01, 0x20, 0xcf, 0x03, 0x00, 0x00,
|
||||
0x79, 0x18, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x1a, 0x03, 0x4c, 0x90,
|
||||
0x46, 0x02, 0x13, 0xc4, 0x8e, 0x0c, 0x6f, 0xec, 0xed, 0x4d, 0x0c, 0x24,
|
||||
0xc6, 0x05, 0xc7, 0x45, 0xa6, 0x06, 0x46, 0xc6, 0x05, 0x07, 0x04, 0x45,
|
||||
0x8c, 0xe6, 0x26, 0x26, 0x06, 0x67, 0x26, 0xa7, 0x2c, 0x65, 0x43, 0x10,
|
||||
0x4c, 0x10, 0x88, 0x62, 0x82, 0x40, 0x18, 0x1b, 0x84, 0x81, 0xd8, 0x20,
|
||||
0x10, 0x04, 0x05, 0xb8, 0xb9, 0x09, 0x02, 0x71, 0x6c, 0x18, 0x0e, 0x84,
|
||||
0x98, 0x20, 0x58, 0x15, 0x93, 0xba, 0x2f, 0xba, 0x32, 0x3c, 0xba, 0x3a,
|
||||
0xb9, 0xb2, 0x09, 0x02, 0x81, 0x4c, 0x10, 0x88, 0x64, 0x83, 0x40, 0x34,
|
||||
0x1b, 0x12, 0x42, 0x59, 0x18, 0x62, 0x60, 0x08, 0x67, 0x43, 0xf0, 0x4c,
|
||||
0x10, 0x30, 0x8b, 0x49, 0xdd, 0xd7, 0x5c, 0x58, 0x1b, 0x1c, 0x5b, 0x99,
|
||||
0xdc, 0x06, 0x84, 0x88, 0x24, 0x86, 0x18, 0x08, 0x60, 0x43, 0x30, 0x6d,
|
||||
0x20, 0x20, 0x00, 0xa0, 0x26, 0x08, 0x02, 0xb0, 0x01, 0xd8, 0x30, 0x10,
|
||||
0xd7, 0xb5, 0x21, 0xc0, 0x36, 0x0c, 0x83, 0x95, 0x4d, 0x10, 0xb2, 0x6b,
|
||||
0x43, 0xb0, 0x91, 0x68, 0x0b, 0x4b, 0x73, 0x23, 0x42, 0x55, 0x84, 0x35,
|
||||
0xf4, 0xf4, 0x24, 0x45, 0x34, 0x41, 0x28, 0xa0, 0x09, 0x42, 0x11, 0x6d,
|
||||
0x08, 0x88, 0x09, 0x42, 0x21, 0x4d, 0x10, 0x8a, 0x69, 0x82, 0x40, 0x28,
|
||||
0x13, 0x04, 0x62, 0xd9, 0x20, 0x90, 0x41, 0x19, 0x6c, 0x58, 0x08, 0xef,
|
||||
0x03, 0x83, 0x30, 0x10, 0x83, 0x61, 0x0c, 0x08, 0x30, 0x30, 0x83, 0x0d,
|
||||
0xc1, 0xb0, 0x41, 0x20, 0x03, 0x32, 0xd8, 0xb0, 0x0c, 0xde, 0x07, 0x06,
|
||||
0x68, 0x20, 0x06, 0x83, 0x18, 0x0c, 0x60, 0x90, 0x06, 0x1b, 0x84, 0x33,
|
||||
0x50, 0x03, 0x26, 0x53, 0x56, 0x5f, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74,
|
||||
0x13, 0x84, 0x82, 0x9a, 0x20, 0x10, 0xcc, 0x06, 0x81, 0x0c, 0xdc, 0x60,
|
||||
0xc3, 0x42, 0xb0, 0xc1, 0xd7, 0x06, 0x61, 0x00, 0x06, 0xc3, 0x18, 0x10,
|
||||
0x60, 0xf0, 0x06, 0x1b, 0x02, 0x38, 0xd8, 0x30, 0xac, 0x41, 0x1c, 0x00,
|
||||
0x1b, 0x0a, 0xab, 0x93, 0x83, 0x0a, 0xa0, 0x61, 0xc6, 0xf6, 0x16, 0x46,
|
||||
0x37, 0xc7, 0x22, 0xcd, 0x6d, 0x8e, 0x6e, 0x6e, 0x82, 0x40, 0x34, 0x34,
|
||||
0xe6, 0xd2, 0xce, 0xbe, 0xd8, 0xc8, 0x26, 0x08, 0x84, 0x43, 0x63, 0x2e,
|
||||
0xed, 0xec, 0x6b, 0x8e, 0x6e, 0x82, 0x40, 0x3c, 0x44, 0xe8, 0xca, 0xf0,
|
||||
0xbe, 0xdc, 0xde, 0xe4, 0xda, 0x36, 0x28, 0x74, 0x80, 0xd4, 0x81, 0x1d,
|
||||
0xdc, 0x01, 0x1e, 0xe4, 0x81, 0x1e, 0xec, 0xc1, 0x50, 0x85, 0x8d, 0xcd,
|
||||
0xae, 0xcd, 0x25, 0x8d, 0xac, 0xcc, 0x8d, 0x6e, 0x4a, 0x10, 0x54, 0x21,
|
||||
0xc3, 0x73, 0xb1, 0x2b, 0x93, 0x9b, 0x4b, 0x7b, 0x73, 0x9b, 0x12, 0x10,
|
||||
0x4d, 0xc8, 0xf0, 0x5c, 0xec, 0xc2, 0xd8, 0xec, 0xca, 0xe4, 0xa6, 0x04,
|
||||
0x45, 0x1d, 0x32, 0x3c, 0x97, 0x39, 0xb4, 0x30, 0xb2, 0x32, 0xb9, 0xa6,
|
||||
0x37, 0xb2, 0x32, 0xb6, 0x29, 0x01, 0x52, 0x86, 0x0c, 0xcf, 0x45, 0xae,
|
||||
0x6c, 0xee, 0xad, 0x4e, 0x6e, 0xac, 0x6c, 0x6e, 0x4a, 0x40, 0x55, 0x22,
|
||||
0xc3, 0x73, 0xa1, 0xcb, 0x83, 0x2b, 0x0b, 0x72, 0x73, 0x7b, 0xa3, 0x0b,
|
||||
0xa3, 0x4b, 0x7b, 0x73, 0x9b, 0x9b, 0x12, 0x64, 0x75, 0xc8, 0xf0, 0x5c,
|
||||
0xec, 0xd2, 0xca, 0xee, 0x92, 0xc8, 0xa6, 0xe8, 0xc2, 0xe8, 0xca, 0xa6,
|
||||
0x04, 0x5b, 0x1d, 0x32, 0x3c, 0x97, 0x32, 0x37, 0x3a, 0xb9, 0x3c, 0xa8,
|
||||
0xb7, 0x34, 0x37, 0xba, 0xb9, 0x29, 0x81, 0x1c, 0x74, 0x21, 0xc3, 0x73,
|
||||
0x19, 0x7b, 0xab, 0x73, 0xa3, 0x2b, 0x93, 0x9b, 0x9b, 0x12, 0xec, 0x01,
|
||||
0x00, 0x00, 0x00, 0x00, 0x79, 0x18, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00,
|
||||
0x33, 0x08, 0x80, 0x1c, 0xc4, 0xe1, 0x1c, 0x66, 0x14, 0x01, 0x3d, 0x88,
|
||||
0x43, 0x38, 0x84, 0xc3, 0x8c, 0x42, 0x80, 0x07, 0x79, 0x78, 0x07, 0x73,
|
||||
0x98, 0x71, 0x0c, 0xe6, 0x00, 0x0f, 0xed, 0x10, 0x0e, 0xf4, 0x80, 0x0e,
|
||||
0x33, 0x0c, 0x42, 0x1e, 0xc2, 0xc1, 0x1d, 0xce, 0xa1, 0x1c, 0x66, 0x30,
|
||||
0x05, 0x3d, 0x88, 0x43, 0x38, 0x84, 0x83, 0x1b, 0xcc, 0x03, 0x3d, 0xc8,
|
||||
0x43, 0x3d, 0x8c, 0x03, 0x3d, 0xcc, 0x78, 0x8c, 0x74, 0x70, 0x07, 0x7b,
|
||||
0x08, 0x07, 0x79, 0x48, 0x87, 0x70, 0x70, 0x07, 0x7a, 0x70, 0x03, 0x76,
|
||||
0x78, 0x87, 0x70, 0x20, 0x87, 0x19, 0xcc, 0x11, 0x0e, 0xec, 0x90, 0x0e,
|
||||
0xe1, 0x30, 0x0f, 0x6e, 0x30, 0x0f, 0xe3, 0xf0, 0x0e, 0xf0, 0x50, 0x0e,
|
||||
0x33, 0x10, 0xc4, 0x1d, 0xde, 0x21, 0x1c, 0xd8, 0x21, 0x1d, 0xc2, 0x61,
|
||||
0x1e, 0x66, 0x30, 0x89, 0x3b, 0xbc, 0x83, 0x3b, 0xd0, 0x43, 0x39, 0xb4,
|
||||
0x03, 0x3c, 0xbc, 0x83, 0x3c, 0x84, 0x03, 0x3b, 0xcc, 0xf0, 0x14, 0x76,
|
||||
0x60, 0x07, 0x7b, 0x68, 0x07, 0x37, 0x68, 0x87, 0x72, 0x68, 0x07, 0x37,
|
||||
0x80, 0x87, 0x70, 0x90, 0x87, 0x70, 0x60, 0x07, 0x76, 0x28, 0x07, 0x76,
|
||||
0xf8, 0x05, 0x76, 0x78, 0x87, 0x77, 0x80, 0x87, 0x5f, 0x08, 0x87, 0x71,
|
||||
0x18, 0x87, 0x72, 0x98, 0x87, 0x79, 0x98, 0x81, 0x2c, 0xee, 0xf0, 0x0e,
|
||||
0xee, 0xe0, 0x0e, 0xf5, 0xc0, 0x0e, 0xec, 0x30, 0x03, 0x62, 0xc8, 0xa1,
|
||||
0x1c, 0xe4, 0xa1, 0x1c, 0xcc, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c, 0xdc, 0x61,
|
||||
0x1c, 0xca, 0x21, 0x1c, 0xc4, 0x81, 0x1d, 0xca, 0x61, 0x06, 0xd6, 0x90,
|
||||
0x43, 0x39, 0xc8, 0x43, 0x39, 0x98, 0x43, 0x39, 0xc8, 0x43, 0x39, 0xb8,
|
||||
0xc3, 0x38, 0x94, 0x43, 0x38, 0x88, 0x03, 0x3b, 0x94, 0xc3, 0x2f, 0xbc,
|
||||
0x83, 0x3c, 0xfc, 0x82, 0x3b, 0xd4, 0x03, 0x3b, 0xb0, 0xc3, 0x8c, 0xc8,
|
||||
0x21, 0x07, 0x7c, 0x70, 0x03, 0x72, 0x10, 0x87, 0x73, 0x70, 0x03, 0x7b,
|
||||
0x08, 0x07, 0x79, 0x60, 0x87, 0x70, 0xc8, 0x87, 0x77, 0xa8, 0x07, 0x7a,
|
||||
0x98, 0x81, 0x3c, 0xe4, 0x80, 0x0f, 0x6e, 0x40, 0x0f, 0xe5, 0xd0, 0x0e,
|
||||
0xf0, 0x00, 0x00, 0x00, 0x71, 0x20, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00,
|
||||
0x46, 0x20, 0x0d, 0x97, 0xef, 0x3c, 0xbe, 0x10, 0x11, 0xc0, 0x44, 0x84,
|
||||
0x40, 0x33, 0x2c, 0x84, 0x05, 0x4c, 0xc3, 0xe5, 0x3b, 0x8f, 0xbf, 0x38,
|
||||
0xc0, 0x20, 0x36, 0x0f, 0x35, 0xf9, 0xc5, 0x6d, 0xdb, 0x00, 0x34, 0x5c,
|
||||
0xbe, 0xf3, 0xf8, 0x12, 0xc0, 0x3c, 0x0b, 0xe1, 0x17, 0xb7, 0x6d, 0x02,
|
||||
0xd5, 0x70, 0xf9, 0xce, 0xe3, 0x4b, 0x93, 0x13, 0x11, 0x28, 0x35, 0x3d,
|
||||
0xd4, 0xe4, 0x17, 0xb7, 0x6d, 0x00, 0x04, 0x03, 0x20, 0x0d, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x48, 0x41, 0x53, 0x48, 0x14, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x56, 0x34, 0x28, 0xb6, 0xc7, 0x9e, 0xae, 0x05,
|
||||
0xf9, 0x5e, 0x19, 0x9a, 0x37, 0xcf, 0x7a, 0x50, 0x44, 0x58, 0x49, 0x4c,
|
||||
0xd4, 0x06, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0xb5, 0x01, 0x00, 0x00,
|
||||
0x44, 0x58, 0x49, 0x4c, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||
0xbc, 0x06, 0x00, 0x00, 0x42, 0x43, 0xc0, 0xde, 0x21, 0x0c, 0x00, 0x00,
|
||||
0xac, 0x01, 0x00, 0x00, 0x0b, 0x82, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x13, 0x00, 0x00, 0x00, 0x07, 0x81, 0x23, 0x91, 0x41, 0xc8, 0x04, 0x49,
|
||||
0x06, 0x10, 0x32, 0x39, 0x92, 0x01, 0x84, 0x0c, 0x25, 0x05, 0x08, 0x19,
|
||||
0x1e, 0x04, 0x8b, 0x62, 0x80, 0x14, 0x45, 0x02, 0x42, 0x92, 0x0b, 0x42,
|
||||
0xa4, 0x10, 0x32, 0x14, 0x38, 0x08, 0x18, 0x4b, 0x0a, 0x32, 0x52, 0x88,
|
||||
0x48, 0x90, 0x14, 0x20, 0x43, 0x46, 0x88, 0xa5, 0x00, 0x19, 0x32, 0x42,
|
||||
0xe4, 0x48, 0x0e, 0x90, 0x91, 0x22, 0xc4, 0x50, 0x41, 0x51, 0x81, 0x8c,
|
||||
0xe1, 0x83, 0xe5, 0x8a, 0x04, 0x29, 0x46, 0x06, 0x51, 0x18, 0x00, 0x00,
|
||||
0x08, 0x00, 0x00, 0x00, 0x1b, 0x8c, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x07,
|
||||
0x40, 0x02, 0xa8, 0x0d, 0x84, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x20,
|
||||
0x6d, 0x30, 0x86, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x09, 0xa8, 0x00,
|
||||
0x49, 0x18, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x13, 0x82, 0x60, 0x42,
|
||||
0x20, 0x4c, 0x08, 0x06, 0x00, 0x00, 0x00, 0x00, 0x89, 0x20, 0x00, 0x00,
|
||||
0x43, 0x00, 0x00, 0x00, 0x32, 0x22, 0x48, 0x09, 0x20, 0x64, 0x85, 0x04,
|
||||
0x93, 0x22, 0xa4, 0x84, 0x04, 0x93, 0x22, 0xe3, 0x84, 0xa1, 0x90, 0x14,
|
||||
0x12, 0x4c, 0x8a, 0x8c, 0x0b, 0x84, 0xa4, 0x4c, 0x10, 0x68, 0x23, 0x00,
|
||||
0x25, 0x00, 0x14, 0x66, 0x00, 0xe6, 0x08, 0xc0, 0x60, 0x8e, 0x00, 0x29,
|
||||
0xc6, 0x20, 0x84, 0x14, 0x42, 0xa6, 0x18, 0x80, 0x10, 0x52, 0x06, 0xa1,
|
||||
0x9b, 0x86, 0xcb, 0x9f, 0xb0, 0x87, 0x90, 0xfc, 0x95, 0x90, 0x56, 0x62,
|
||||
0xf2, 0x8b, 0xdb, 0x46, 0xc5, 0x18, 0x63, 0x10, 0x2a, 0xf7, 0x0c, 0x97,
|
||||
0x3f, 0x61, 0x0f, 0x21, 0xf9, 0x21, 0xd0, 0x0c, 0x0b, 0x81, 0x82, 0x55,
|
||||
0x18, 0x45, 0x18, 0x1b, 0x63, 0x0c, 0x42, 0xc8, 0xa0, 0x36, 0x47, 0x10,
|
||||
0x14, 0x83, 0x91, 0x42, 0xc8, 0x23, 0x38, 0x10, 0x30, 0x8c, 0x40, 0x0c,
|
||||
0x33, 0xb5, 0xc1, 0x38, 0xb0, 0x43, 0x38, 0xcc, 0xc3, 0x3c, 0xb8, 0x01,
|
||||
0x2d, 0x94, 0x03, 0x3e, 0xd0, 0x43, 0x3d, 0xc8, 0x43, 0x39, 0xc8, 0x01,
|
||||
0x29, 0xf0, 0x81, 0x3d, 0x94, 0xc3, 0x38, 0xd0, 0xc3, 0x3b, 0xc8, 0x03,
|
||||
0x1f, 0x98, 0x03, 0x3b, 0xbc, 0x43, 0x38, 0xd0, 0x03, 0x1b, 0x80, 0x01,
|
||||
0x1d, 0xf8, 0x01, 0x18, 0xf8, 0x81, 0x1e, 0xe8, 0x41, 0x3b, 0xa4, 0x03,
|
||||
0x3c, 0xcc, 0xc3, 0x2f, 0xd0, 0x43, 0x3e, 0xc0, 0x43, 0x39, 0xa0, 0x80,
|
||||
0xcc, 0x24, 0x06, 0xe3, 0xc0, 0x0e, 0xe1, 0x30, 0x0f, 0xf3, 0xe0, 0x06,
|
||||
0xb4, 0x50, 0x0e, 0xf8, 0x40, 0x0f, 0xf5, 0x20, 0x0f, 0xe5, 0x20, 0x07,
|
||||
0xa4, 0xc0, 0x07, 0xf6, 0x50, 0x0e, 0xe3, 0x40, 0x0f, 0xef, 0x20, 0x0f,
|
||||
0x7c, 0x60, 0x0e, 0xec, 0xf0, 0x0e, 0xe1, 0x40, 0x0f, 0x6c, 0x00, 0x06,
|
||||
0x74, 0xe0, 0x07, 0x60, 0xe0, 0x07, 0x48, 0x98, 0x94, 0xea, 0x4d, 0xd2,
|
||||
0x14, 0x51, 0xc2, 0xe4, 0xb3, 0x00, 0xf3, 0x2c, 0x44, 0xc4, 0x4e, 0xc0,
|
||||
0x44, 0xa0, 0x80, 0xd0, 0x4d, 0x04, 0x02, 0x00, 0x13, 0x14, 0x72, 0xc0,
|
||||
0x87, 0x74, 0x60, 0x87, 0x36, 0x68, 0x87, 0x79, 0x68, 0x03, 0x72, 0xc0,
|
||||
0x87, 0x0d, 0xaf, 0x50, 0x0e, 0x6d, 0xd0, 0x0e, 0x7a, 0x50, 0x0e, 0x6d,
|
||||
0x00, 0x0f, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d,
|
||||
0x90, 0x0e, 0x71, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x78,
|
||||
0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x71, 0x60, 0x07, 0x7a,
|
||||
0x30, 0x07, 0x72, 0xd0, 0x06, 0xe9, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x73,
|
||||
0x20, 0x07, 0x6d, 0x90, 0x0e, 0x76, 0x40, 0x07, 0x7a, 0x60, 0x07, 0x74,
|
||||
0xd0, 0x06, 0xe6, 0x10, 0x07, 0x76, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d,
|
||||
0x60, 0x0e, 0x73, 0x20, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0, 0x06, 0xe6,
|
||||
0x60, 0x07, 0x74, 0xa0, 0x07, 0x76, 0x40, 0x07, 0x6d, 0xe0, 0x0e, 0x78,
|
||||
0xa0, 0x07, 0x71, 0x60, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x76,
|
||||
0x40, 0x07, 0x43, 0x9e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x86, 0x3c, 0x06, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x0c, 0x79, 0x10, 0x20, 0x00, 0x04, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0xf2, 0x34, 0x40, 0x00, 0x0c, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xe4, 0x81, 0x80, 0x00, 0x18,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x0b, 0x04, 0x00, 0x00,
|
||||
0x0e, 0x00, 0x00, 0x00, 0x32, 0x1e, 0x98, 0x14, 0x19, 0x11, 0x4c, 0x90,
|
||||
0x8c, 0x09, 0x26, 0x47, 0xc6, 0x04, 0x43, 0x22, 0x25, 0x30, 0x02, 0x50,
|
||||
0x10, 0xc5, 0x50, 0x04, 0x25, 0x51, 0x06, 0x65, 0x51, 0x1e, 0x54, 0x4a,
|
||||
0x62, 0x04, 0xa0, 0x08, 0x0a, 0xa1, 0x40, 0xc8, 0xce, 0x00, 0x10, 0x9e,
|
||||
0x01, 0xa0, 0x3c, 0x16, 0x62, 0x10, 0xc7, 0x01, 0x20, 0xcf, 0x03, 0x00,
|
||||
0x79, 0x18, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x1a, 0x03, 0x4c, 0x90,
|
||||
0x46, 0x02, 0x13, 0xc4, 0x8e, 0x0c, 0x6f, 0xec, 0xed, 0x4d, 0x0c, 0x24,
|
||||
0xc6, 0x05, 0xc7, 0x45, 0xa6, 0x06, 0x46, 0xc6, 0x05, 0x07, 0x04, 0x45,
|
||||
0x8c, 0xe6, 0x26, 0x26, 0x06, 0x67, 0x26, 0xa7, 0x2c, 0x65, 0x43, 0x10,
|
||||
0x4c, 0x10, 0x88, 0x62, 0x82, 0x40, 0x18, 0x1b, 0x84, 0x81, 0x98, 0x20,
|
||||
0x10, 0xc7, 0x06, 0x61, 0x30, 0x28, 0xc0, 0xcd, 0x4d, 0x10, 0x08, 0x64,
|
||||
0xc3, 0x80, 0x24, 0xc4, 0x04, 0xc1, 0x9a, 0x08, 0x4c, 0x10, 0x88, 0x64,
|
||||
0x82, 0x40, 0x28, 0x1b, 0x04, 0xc2, 0xd9, 0x90, 0x10, 0x0b, 0xd3, 0x10,
|
||||
0x43, 0x43, 0x3c, 0x1b, 0x02, 0x68, 0x82, 0x80, 0x51, 0x1b, 0x10, 0x42,
|
||||
0x62, 0x1a, 0x62, 0x20, 0x80, 0x0d, 0xc1, 0xb4, 0x81, 0x88, 0x00, 0x80,
|
||||
0x9a, 0x20, 0x64, 0xd5, 0x86, 0xc0, 0x9a, 0x20, 0x08, 0x00, 0x89, 0xb6,
|
||||
0xb0, 0x34, 0x37, 0x22, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44,
|
||||
0x13, 0x84, 0xc2, 0x99, 0x20, 0x14, 0xcf, 0x86, 0x80, 0x98, 0x20, 0x14,
|
||||
0xd0, 0x04, 0xa1, 0x88, 0x26, 0x08, 0xc4, 0x32, 0x41, 0x20, 0x98, 0x0d,
|
||||
0x02, 0x18, 0x84, 0xc1, 0x86, 0x85, 0xd0, 0x36, 0xae, 0xf3, 0x86, 0x8f,
|
||||
0xe0, 0xc4, 0x60, 0x43, 0x30, 0x6c, 0x10, 0xc0, 0x00, 0x0c, 0x36, 0x2c,
|
||||
0x83, 0xb6, 0x71, 0x64, 0xe0, 0x0d, 0xde, 0xc0, 0x95, 0xc1, 0x06, 0x61,
|
||||
0x0c, 0xcc, 0x80, 0xc9, 0x94, 0xd5, 0x17, 0x55, 0x98, 0xdc, 0x59, 0x19,
|
||||
0xdd, 0x04, 0xa1, 0x90, 0x26, 0x08, 0x44, 0xb3, 0x41, 0x00, 0x03, 0x35,
|
||||
0xd8, 0xb0, 0x10, 0x68, 0xb0, 0xa5, 0x41, 0xc7, 0x0d, 0x1f, 0xc1, 0xad,
|
||||
0xc1, 0x86, 0x80, 0x0d, 0x36, 0x0c, 0x67, 0xd0, 0x06, 0xc0, 0x86, 0x02,
|
||||
0xcb, 0xdc, 0xa0, 0x02, 0xaa, 0xb0, 0xb1, 0xd9, 0xb5, 0xb9, 0xa4, 0x91,
|
||||
0x95, 0xb9, 0xd1, 0x4d, 0x09, 0x82, 0x2a, 0x64, 0x78, 0x2e, 0x76, 0x65,
|
||||
0x72, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x02, 0xa2, 0x09, 0x19, 0x9e, 0x8b,
|
||||
0x5d, 0x18, 0x9b, 0x5d, 0x99, 0xdc, 0x94, 0xc0, 0xa8, 0x43, 0x86, 0xe7,
|
||||
0x32, 0x87, 0x16, 0x46, 0x56, 0x26, 0xd7, 0xf4, 0x46, 0x56, 0xc6, 0x36,
|
||||
0x25, 0x48, 0xca, 0x90, 0xe1, 0xb9, 0xc8, 0x95, 0xcd, 0xbd, 0xd5, 0xc9,
|
||||
0x8d, 0x95, 0xcd, 0x4d, 0x09, 0xa8, 0x3a, 0x64, 0x78, 0x2e, 0x76, 0x69,
|
||||
0x65, 0x77, 0x49, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x02, 0xab,
|
||||
0x0e, 0x19, 0x9e, 0x4b, 0x99, 0x1b, 0x9d, 0x5c, 0x1e, 0xd4, 0x5b, 0x9a,
|
||||
0x1b, 0xdd, 0xdc, 0x94, 0xc0, 0x0d, 0x00, 0x00, 0x79, 0x18, 0x00, 0x00,
|
||||
0x4c, 0x00, 0x00, 0x00, 0x33, 0x08, 0x80, 0x1c, 0xc4, 0xe1, 0x1c, 0x66,
|
||||
0x14, 0x01, 0x3d, 0x88, 0x43, 0x38, 0x84, 0xc3, 0x8c, 0x42, 0x80, 0x07,
|
||||
0x79, 0x78, 0x07, 0x73, 0x98, 0x71, 0x0c, 0xe6, 0x00, 0x0f, 0xed, 0x10,
|
||||
0x0e, 0xf4, 0x80, 0x0e, 0x33, 0x0c, 0x42, 0x1e, 0xc2, 0xc1, 0x1d, 0xce,
|
||||
0xa1, 0x1c, 0x66, 0x30, 0x05, 0x3d, 0x88, 0x43, 0x38, 0x84, 0x83, 0x1b,
|
||||
0xcc, 0x03, 0x3d, 0xc8, 0x43, 0x3d, 0x8c, 0x03, 0x3d, 0xcc, 0x78, 0x8c,
|
||||
0x74, 0x70, 0x07, 0x7b, 0x08, 0x07, 0x79, 0x48, 0x87, 0x70, 0x70, 0x07,
|
||||
0x7a, 0x70, 0x03, 0x76, 0x78, 0x87, 0x70, 0x20, 0x87, 0x19, 0xcc, 0x11,
|
||||
0x0e, 0xec, 0x90, 0x0e, 0xe1, 0x30, 0x0f, 0x6e, 0x30, 0x0f, 0xe3, 0xf0,
|
||||
0x0e, 0xf0, 0x50, 0x0e, 0x33, 0x10, 0xc4, 0x1d, 0xde, 0x21, 0x1c, 0xd8,
|
||||
0x21, 0x1d, 0xc2, 0x61, 0x1e, 0x66, 0x30, 0x89, 0x3b, 0xbc, 0x83, 0x3b,
|
||||
0xd0, 0x43, 0x39, 0xb4, 0x03, 0x3c, 0xbc, 0x83, 0x3c, 0x84, 0x03, 0x3b,
|
||||
0xcc, 0xf0, 0x14, 0x76, 0x60, 0x07, 0x7b, 0x68, 0x07, 0x37, 0x68, 0x87,
|
||||
0x72, 0x68, 0x07, 0x37, 0x80, 0x87, 0x70, 0x90, 0x87, 0x70, 0x60, 0x07,
|
||||
0x76, 0x28, 0x07, 0x76, 0xf8, 0x05, 0x76, 0x78, 0x87, 0x77, 0x80, 0x87,
|
||||
0x5f, 0x08, 0x87, 0x71, 0x18, 0x87, 0x72, 0x98, 0x87, 0x79, 0x98, 0x81,
|
||||
0x2c, 0xee, 0xf0, 0x0e, 0xee, 0xe0, 0x0e, 0xf5, 0xc0, 0x0e, 0xec, 0x30,
|
||||
0x03, 0x62, 0xc8, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c, 0xcc, 0xa1, 0x1c, 0xe4,
|
||||
0xa1, 0x1c, 0xdc, 0x61, 0x1c, 0xca, 0x21, 0x1c, 0xc4, 0x81, 0x1d, 0xca,
|
||||
0x61, 0x06, 0xd6, 0x90, 0x43, 0x39, 0xc8, 0x43, 0x39, 0x98, 0x43, 0x39,
|
||||
0xc8, 0x43, 0x39, 0xb8, 0xc3, 0x38, 0x94, 0x43, 0x38, 0x88, 0x03, 0x3b,
|
||||
0x94, 0xc3, 0x2f, 0xbc, 0x83, 0x3c, 0xfc, 0x82, 0x3b, 0xd4, 0x03, 0x3b,
|
||||
0xb0, 0xc3, 0x8c, 0xc8, 0x21, 0x07, 0x7c, 0x70, 0x03, 0x72, 0x10, 0x87,
|
||||
0x73, 0x70, 0x03, 0x7b, 0x08, 0x07, 0x79, 0x60, 0x87, 0x70, 0xc8, 0x87,
|
||||
0x77, 0xa8, 0x07, 0x7a, 0x98, 0x81, 0x3c, 0xe4, 0x80, 0x0f, 0x6e, 0x40,
|
||||
0x0f, 0xe5, 0xd0, 0x0e, 0xf0, 0x00, 0x00, 0x00, 0x71, 0x20, 0x00, 0x00,
|
||||
0x12, 0x00, 0x00, 0x00, 0x46, 0x20, 0x0d, 0x97, 0xef, 0x3c, 0xbe, 0x10,
|
||||
0x11, 0xc0, 0x44, 0x84, 0x40, 0x33, 0x2c, 0x84, 0x05, 0x4c, 0xc3, 0xe5,
|
||||
0x3b, 0x8f, 0xbf, 0x38, 0xc0, 0x20, 0x36, 0x0f, 0x35, 0xf9, 0xc5, 0x6d,
|
||||
0xdb, 0x00, 0x34, 0x5c, 0xbe, 0xf3, 0xf8, 0x12, 0xc0, 0x3c, 0x0b, 0xe1,
|
||||
0x17, 0xb7, 0x6d, 0x02, 0xd5, 0x70, 0xf9, 0xce, 0xe3, 0x4b, 0x93, 0x13,
|
||||
0x11, 0x28, 0x35, 0x3d, 0xd4, 0xe4, 0x17, 0xb7, 0x6d, 0x00, 0x04, 0x03,
|
||||
0x20, 0x0d, 0x00, 0x00, 0x61, 0x20, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00,
|
||||
0x13, 0x04, 0x41, 0x2c, 0x10, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00,
|
||||
0xf4, 0x46, 0x00, 0xa8, 0x94, 0x40, 0x19, 0x10, 0x99, 0x01, 0x28, 0x84,
|
||||
0x52, 0x28, 0xb9, 0xc2, 0xa3, 0x31, 0x46, 0xc0, 0x97, 0xbd, 0xd9, 0x7e,
|
||||
0x63, 0x04, 0x62, 0x1b, 0xb3, 0xf1, 0x37, 0x03, 0x00, 0x00, 0x00, 0x00,
|
||||
0x23, 0x06, 0x09, 0x00, 0x82, 0x60, 0x00, 0x75, 0x85, 0xb4, 0x6d, 0xcb,
|
||||
0x88, 0x41, 0x02, 0x80, 0x20, 0x18, 0x40, 0x9e, 0xa1, 0x70, 0x1c, 0x33,
|
||||
0x62, 0x90, 0x00, 0x20, 0x08, 0x06, 0x86, 0x18, 0x24, 0x5e, 0x47, 0x29,
|
||||
0x23, 0x06, 0x09, 0x00, 0x82, 0x60, 0x60, 0x8c, 0x81, 0xf2, 0x79, 0xcd,
|
||||
0x32, 0x62, 0x90, 0x00, 0x20, 0x08, 0x06, 0x06, 0x19, 0x2c, 0xdf, 0x67,
|
||||
0x31, 0x23, 0x06, 0x09, 0x00, 0x82, 0x60, 0x60, 0x94, 0x01, 0x03, 0x06,
|
||||
0x60, 0xf0, 0x34, 0x23, 0x06, 0x09, 0x00, 0x82, 0x60, 0x60, 0x98, 0x41,
|
||||
0x13, 0x06, 0x61, 0xf0, 0x38, 0x23, 0x06, 0x0f, 0x00, 0x82, 0x60, 0xd0,
|
||||
0x94, 0xc1, 0x72, 0x18, 0x05, 0x81, 0x20, 0x62, 0x20, 0x06, 0x0f, 0x32,
|
||||
0x9a, 0x10, 0x00, 0xa3, 0x09, 0x42, 0x30, 0x9a, 0x30, 0x0c, 0x16, 0x14,
|
||||
0xf2, 0xb1, 0xc3, 0x91, 0x8f, 0x05, 0x84, 0x7c, 0x4c, 0x89, 0xe4, 0x63,
|
||||
0xc1, 0x21, 0x1f, 0x0b, 0x06, 0xf8, 0x8c, 0x18, 0x24, 0x00, 0x08, 0x82,
|
||||
0x01, 0x02, 0x07, 0x17, 0x1b, 0xb0, 0xc1, 0x18, 0x04, 0x23, 0x06, 0x09,
|
||||
0x00, 0x82, 0x60, 0x80, 0xc0, 0xc1, 0xc5, 0x06, 0x6c, 0xb0, 0x05, 0x23,
|
||||
0x06, 0x09, 0x00, 0x82, 0x60, 0x80, 0xc0, 0xc1, 0xc5, 0x06, 0x6c, 0x20,
|
||||
0x06, 0xc1, 0x88, 0x41, 0x02, 0x80, 0x20, 0x18, 0x20, 0x70, 0x70, 0xb1,
|
||||
0x01, 0x1b, 0x68, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
static const unsigned int testgpu_effects_grayscale_frag_dxil_len = 3900;
|
||||
@@ -0,0 +1,19 @@
|
||||
Texture2D u_texture : register(t0, space2);
|
||||
SamplerState u_sampler : register(s0, space2);
|
||||
|
||||
struct PSInput {
|
||||
float4 v_color : COLOR0;
|
||||
float2 v_uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct PSOutput {
|
||||
float4 o_color : SV_Target;
|
||||
};
|
||||
|
||||
PSOutput main(PSInput input) {
|
||||
PSOutput output;
|
||||
float4 color = u_texture.Sample(u_sampler, input.v_uv) * input.v_color;
|
||||
float gray = color.r * 0.299 + color.g * 0.587 + color.r * 0.114;
|
||||
output.o_color = float4(gray, gray, gray, color.a);
|
||||
return output;
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
static const unsigned char testgpu_effects_grayscale_frag_msl[] = {
|
||||
0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65,
|
||||
0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x3e, 0x0a,
|
||||
0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x73, 0x69,
|
||||
0x6d, 0x64, 0x2f, 0x73, 0x69, 0x6d, 0x64, 0x2e, 0x68, 0x3e, 0x0a, 0x0a,
|
||||
0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70,
|
||||
0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x0a,
|
||||
0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x30,
|
||||
0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66,
|
||||
0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x6f, 0x75, 0x74, 0x5f, 0x76, 0x61,
|
||||
0x72, 0x5f, 0x53, 0x56, 0x5f, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x20,
|
||||
0x5b, 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d,
|
||||
0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74,
|
||||
0x20, 0x6d, 0x61, 0x69, 0x6e, 0x30, 0x5f, 0x69, 0x6e, 0x0a, 0x7b, 0x0a,
|
||||
0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x69,
|
||||
0x6e, 0x5f, 0x76, 0x61, 0x72, 0x5f, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x30,
|
||||
0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e,
|
||||
0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c,
|
||||
0x6f, 0x61, 0x74, 0x32, 0x20, 0x69, 0x6e, 0x5f, 0x76, 0x61, 0x72, 0x5f,
|
||||
0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x30, 0x20, 0x5b, 0x5b,
|
||||
0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, 0x31, 0x29, 0x5d,
|
||||
0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x66, 0x72, 0x61, 0x67, 0x6d,
|
||||
0x65, 0x6e, 0x74, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x30, 0x5f, 0x6f, 0x75,
|
||||
0x74, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x30, 0x28, 0x6d, 0x61, 0x69, 0x6e,
|
||||
0x30, 0x5f, 0x69, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x5b, 0x5b, 0x73, 0x74,
|
||||
0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x74, 0x65,
|
||||
0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x64, 0x3c, 0x66, 0x6c, 0x6f, 0x61,
|
||||
0x74, 0x3e, 0x20, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65,
|
||||
0x20, 0x5b, 0x5b, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x28, 0x30,
|
||||
0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72,
|
||||
0x20, 0x75, 0x5f, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x20, 0x5b,
|
||||
0x5b, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d,
|
||||
0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x61, 0x69,
|
||||
0x6e, 0x30, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x3d,
|
||||
0x20, 0x7b, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f,
|
||||
0x61, 0x74, 0x34, 0x20, 0x5f, 0x33, 0x30, 0x20, 0x3d, 0x20, 0x75, 0x5f,
|
||||
0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x73, 0x61, 0x6d, 0x70,
|
||||
0x6c, 0x65, 0x28, 0x75, 0x5f, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72,
|
||||
0x2c, 0x20, 0x69, 0x6e, 0x2e, 0x69, 0x6e, 0x5f, 0x76, 0x61, 0x72, 0x5f,
|
||||
0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x30, 0x29, 0x20, 0x2a,
|
||||
0x20, 0x69, 0x6e, 0x2e, 0x69, 0x6e, 0x5f, 0x76, 0x61, 0x72, 0x5f, 0x43,
|
||||
0x4f, 0x4c, 0x4f, 0x52, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66,
|
||||
0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x33, 0x31, 0x20, 0x3d, 0x20, 0x5f,
|
||||
0x33, 0x30, 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c,
|
||||
0x6f, 0x61, 0x74, 0x20, 0x5f, 0x33, 0x37, 0x20, 0x3d, 0x20, 0x28, 0x28,
|
||||
0x5f, 0x33, 0x31, 0x20, 0x2a, 0x20, 0x30, 0x2e, 0x32, 0x39, 0x38, 0x39,
|
||||
0x39, 0x39, 0x39, 0x39, 0x34, 0x39, 0x39, 0x33, 0x32, 0x30, 0x39, 0x38,
|
||||
0x33, 0x38, 0x38, 0x36, 0x37, 0x31, 0x38, 0x37, 0x35, 0x29, 0x20, 0x2b,
|
||||
0x20, 0x28, 0x5f, 0x33, 0x30, 0x2e, 0x79, 0x20, 0x2a, 0x20, 0x30, 0x2e,
|
||||
0x35, 0x38, 0x37, 0x30, 0x30, 0x30, 0x30, 0x31, 0x32, 0x33, 0x39, 0x37,
|
||||
0x37, 0x36, 0x36, 0x31, 0x31, 0x33, 0x32, 0x38, 0x31, 0x32, 0x35, 0x29,
|
||||
0x29, 0x20, 0x2b, 0x20, 0x28, 0x5f, 0x33, 0x31, 0x20, 0x2a, 0x20, 0x30,
|
||||
0x2e, 0x31, 0x31, 0x34, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x35,
|
||||
0x39, 0x36, 0x30, 0x34, 0x36, 0x34, 0x34, 0x37, 0x37, 0x35, 0x33, 0x39,
|
||||
0x30, 0x36, 0x32, 0x35, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f,
|
||||
0x75, 0x74, 0x2e, 0x6f, 0x75, 0x74, 0x5f, 0x76, 0x61, 0x72, 0x5f, 0x53,
|
||||
0x56, 0x5f, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x20, 0x3d, 0x20, 0x66,
|
||||
0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x5f, 0x33, 0x37, 0x2c, 0x20, 0x5f,
|
||||
0x33, 0x37, 0x2c, 0x20, 0x5f, 0x33, 0x37, 0x2c, 0x20, 0x5f, 0x33, 0x30,
|
||||
0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74,
|
||||
0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a
|
||||
};
|
||||
static const unsigned int testgpu_effects_grayscale_frag_msl_len = 720;
|
||||
@@ -0,0 +1,96 @@
|
||||
static const unsigned char testgpu_effects_grayscale_frag_spv[] = {
|
||||
0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0e, 0x00,
|
||||
0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
|
||||
0x10, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0x58, 0x02, 0x00, 0x00,
|
||||
0x05, 0x00, 0x06, 0x00, 0x05, 0x00, 0x00, 0x00, 0x74, 0x79, 0x70, 0x65,
|
||||
0x2e, 0x32, 0x64, 0x2e, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x00, 0x00, 0x00,
|
||||
0x05, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x74, 0x65,
|
||||
0x78, 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00,
|
||||
0x07, 0x00, 0x00, 0x00, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x73, 0x61, 0x6d,
|
||||
0x70, 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00,
|
||||
0x08, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65,
|
||||
0x72, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x69, 0x6e, 0x2e, 0x76, 0x61, 0x72, 0x2e, 0x43, 0x4f, 0x4c, 0x4f, 0x52,
|
||||
0x30, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x03, 0x00, 0x00, 0x00,
|
||||
0x69, 0x6e, 0x2e, 0x76, 0x61, 0x72, 0x2e, 0x54, 0x45, 0x58, 0x43, 0x4f,
|
||||
0x4f, 0x52, 0x44, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00,
|
||||
0x04, 0x00, 0x00, 0x00, 0x6f, 0x75, 0x74, 0x2e, 0x76, 0x61, 0x72, 0x2e,
|
||||
0x53, 0x56, 0x5f, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x00, 0x00, 0x00,
|
||||
0x05, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e,
|
||||
0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x09, 0x00, 0x00, 0x00,
|
||||
0x74, 0x79, 0x70, 0x65, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x64,
|
||||
0x2e, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x47, 0x00, 0x04, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00,
|
||||
0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
|
||||
0x06, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x47, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00,
|
||||
0x22, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
|
||||
0x08, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x16, 0x00, 0x03, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
|
||||
0x2b, 0x00, 0x04, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00,
|
||||
0x87, 0x16, 0x99, 0x3e, 0x2b, 0x00, 0x04, 0x00, 0x0a, 0x00, 0x00, 0x00,
|
||||
0x0c, 0x00, 0x00, 0x00, 0xa2, 0x45, 0x16, 0x3f, 0x2b, 0x00, 0x04, 0x00,
|
||||
0x0a, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xd5, 0x78, 0xe9, 0x3d,
|
||||
0x19, 0x00, 0x09, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x20, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x05, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x07, 0x00, 0x00, 0x00,
|
||||
0x20, 0x00, 0x04, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x07, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||
0x0a, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
|
||||
0x11, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||
0x17, 0x00, 0x04, 0x00, 0x12, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x13, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
|
||||
0x14, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||
0x13, 0x00, 0x02, 0x00, 0x15, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00,
|
||||
0x16, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x03, 0x00,
|
||||
0x09, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00,
|
||||
0x0e, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x3b, 0x00, 0x04, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x11, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00,
|
||||
0x13, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x3b, 0x00, 0x04, 0x00, 0x14, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x15, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00,
|
||||
0xf8, 0x00, 0x02, 0x00, 0x17, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00,
|
||||
0x10, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x3d, 0x00, 0x04, 0x00, 0x12, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x05, 0x00, 0x00, 0x00,
|
||||
0x1a, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00,
|
||||
0x07, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
|
||||
0x56, 0x00, 0x05, 0x00, 0x09, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00,
|
||||
0x1a, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x57, 0x00, 0x06, 0x00,
|
||||
0x10, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00,
|
||||
0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00,
|
||||
0x10, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00,
|
||||
0x18, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x0a, 0x00, 0x00, 0x00,
|
||||
0x1f, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x85, 0x00, 0x05, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
|
||||
0x1f, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00,
|
||||
0x0a, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x0a, 0x00, 0x00, 0x00,
|
||||
0x22, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
|
||||
0x81, 0x00, 0x05, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00,
|
||||
0x20, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00,
|
||||
0x0a, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00,
|
||||
0x0d, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x0a, 0x00, 0x00, 0x00,
|
||||
0x25, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00,
|
||||
0x51, 0x00, 0x05, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00,
|
||||
0x1e, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00,
|
||||
0x10, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00,
|
||||
0x25, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00,
|
||||
0x3e, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00,
|
||||
0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00
|
||||
};
|
||||
static const unsigned int testgpu_effects_grayscale_frag_spv_len = 1112;
|
||||
@@ -0,0 +1,318 @@
|
||||
/*
|
||||
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely.
|
||||
*/
|
||||
|
||||
#define SDL_MAIN_USE_CALLBACKS 1 /* use the callbacks instead of main() */
|
||||
#include <SDL3/SDL.h>
|
||||
#include <SDL3/SDL_main.h>
|
||||
|
||||
#include "testutils.h"
|
||||
|
||||
/* This font was created with:
|
||||
* ./msdf-atlas-gen.exe -font OpenSans-VariableFont_wdth,wght.ttf -chars '[32,126]' -type msdf -potr -yorigin top -imageout msdf_font.bmp -csv msdf_font.csv
|
||||
*/
|
||||
|
||||
/* This is the distance field range in pixels used when generating the font atlas, defaults to 2 */
|
||||
#define DISTANCE_FIELD_RANGE 2.0f
|
||||
|
||||
/* MSDF shaders */
|
||||
#include "testgpurender_msdf.frag.dxil.h"
|
||||
#include "testgpurender_msdf.frag.msl.h"
|
||||
#include "testgpurender_msdf.frag.spv.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float distance_field_range;
|
||||
float texture_width;
|
||||
float texture_height;
|
||||
float padding;
|
||||
} MSDFShaderUniforms;
|
||||
|
||||
static SDL_Window *window = NULL;
|
||||
static SDL_Renderer *renderer = NULL;
|
||||
static SDL_Texture *font_texture = NULL;
|
||||
static SDL_GPUDevice *device = NULL;
|
||||
static SDL_GPUShader *shader = NULL;
|
||||
static SDL_GPURenderState *render_state = NULL;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
bool loaded;
|
||||
SDL_FRect src;
|
||||
SDL_FRect dst;
|
||||
float advance;
|
||||
} GlyphInfo;
|
||||
|
||||
static GlyphInfo glyphs[128];
|
||||
|
||||
static bool LoadFontTexture(void)
|
||||
{
|
||||
font_texture = LoadTexture(renderer, "msdf_font.bmp", false);
|
||||
if (!font_texture) {
|
||||
SDL_Log("Failed to create font texture: %s", SDL_GetError());
|
||||
return false;
|
||||
}
|
||||
SDL_SetTextureBlendMode(font_texture, SDL_BLENDMODE_BLEND);
|
||||
|
||||
/* Set the font color, doesn't need to be done every frame */
|
||||
SDL_SetTextureColorMod(font_texture, 0, 0, 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool LoadFontLayout(void)
|
||||
{
|
||||
const char *file = "msdf_font.csv";
|
||||
char *path;
|
||||
int offset = 0, len, codepoint;
|
||||
float src_left, src_top, src_right, src_bottom;
|
||||
float dst_left, dst_top, dst_right, dst_bottom;
|
||||
float advance;
|
||||
char *font_layout;
|
||||
|
||||
path = GetNearbyFilename(file);
|
||||
if (path) {
|
||||
font_layout = (char *)SDL_LoadFile(path, NULL);
|
||||
SDL_free(path);
|
||||
} else {
|
||||
font_layout = (char *)SDL_LoadFile(file, NULL);
|
||||
}
|
||||
if (!font_layout) {
|
||||
SDL_Log("Failed to load font layout: %s", SDL_GetError());
|
||||
return false;
|
||||
}
|
||||
|
||||
while (SDL_sscanf(&font_layout[offset], "%d,%f,%f,%f,%f,%f,%f,%f,%f,%f%n",
|
||||
&codepoint, &advance,
|
||||
&dst_left, &dst_top, &dst_right, &dst_bottom,
|
||||
&src_left, &src_top, &src_right, &src_bottom, &len) == 10) {
|
||||
if (codepoint >= 0 && codepoint < SDL_arraysize(glyphs)) {
|
||||
GlyphInfo *glyph = &glyphs[codepoint];
|
||||
glyph->loaded = true;
|
||||
glyph->src.x = src_left;
|
||||
glyph->src.y = src_top;
|
||||
glyph->src.w = src_right - src_left;
|
||||
glyph->src.h = src_bottom - src_top;
|
||||
glyph->dst.x = dst_left;
|
||||
glyph->dst.y = dst_top;
|
||||
glyph->dst.w = dst_right - dst_left;
|
||||
glyph->dst.h = dst_bottom - dst_top;
|
||||
glyph->advance = advance;
|
||||
}
|
||||
offset += len;
|
||||
}
|
||||
SDL_free(font_layout);
|
||||
return true;
|
||||
}
|
||||
|
||||
static float MeasureText(const char *text, float font_size)
|
||||
{
|
||||
float width = 0.0f;
|
||||
|
||||
while (*text) {
|
||||
GlyphInfo *glyph;
|
||||
Uint32 codepoint = SDL_StepUTF8(&text, NULL);
|
||||
if (codepoint >= SDL_arraysize(glyphs)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
glyph = &glyphs[codepoint];
|
||||
if (!glyph->loaded) {
|
||||
continue;
|
||||
}
|
||||
width += (glyph->advance * font_size);
|
||||
}
|
||||
return width;
|
||||
}
|
||||
|
||||
static void RenderText(const char *text, float font_size, float x, float y)
|
||||
{
|
||||
SDL_FRect dst;
|
||||
|
||||
/* The y coordinate is actually the baseline for the text */
|
||||
|
||||
while (*text) {
|
||||
GlyphInfo *glyph;
|
||||
Uint32 codepoint = SDL_StepUTF8(&text, NULL);
|
||||
if (codepoint >= SDL_arraysize(glyphs)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
glyph = &glyphs[codepoint];
|
||||
if (!glyph->loaded) {
|
||||
continue;
|
||||
}
|
||||
|
||||
dst.x = x + glyph->dst.x * font_size;
|
||||
dst.y = y + glyph->dst.y * font_size;
|
||||
dst.w = glyph->dst.w * font_size;
|
||||
dst.h = glyph->dst.h * font_size;
|
||||
SDL_RenderTexture(renderer, font_texture, &glyph->src, &dst);
|
||||
x += (glyph->advance * font_size);
|
||||
}
|
||||
}
|
||||
|
||||
static bool InitGPURenderState(void)
|
||||
{
|
||||
SDL_GPUShaderFormat formats;
|
||||
SDL_GPUShaderCreateInfo info;
|
||||
SDL_GPURenderStateDesc desc;
|
||||
MSDFShaderUniforms uniforms;
|
||||
|
||||
device = (SDL_GPUDevice *)SDL_GetPointerProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_GPU_DEVICE_POINTER, NULL);
|
||||
if (!device) {
|
||||
SDL_Log("Couldn't get GPU device");
|
||||
return false;
|
||||
}
|
||||
|
||||
formats = SDL_GetGPUShaderFormats(device);
|
||||
if (formats == SDL_GPU_SHADERFORMAT_INVALID) {
|
||||
SDL_Log("Couldn't get supported shader formats: %s", SDL_GetError());
|
||||
return false;
|
||||
}
|
||||
|
||||
SDL_zero(info);
|
||||
if (formats & SDL_GPU_SHADERFORMAT_SPIRV) {
|
||||
info.format = SDL_GPU_SHADERFORMAT_SPIRV;
|
||||
info.code = testgpurender_msdf_frag_spv;
|
||||
info.code_size = testgpurender_msdf_frag_spv_len;
|
||||
} else if (formats & SDL_GPU_SHADERFORMAT_DXIL) {
|
||||
info.format = SDL_GPU_SHADERFORMAT_DXIL;
|
||||
info.code = testgpurender_msdf_frag_dxil;
|
||||
info.code_size = testgpurender_msdf_frag_dxil_len;
|
||||
} else if (formats & SDL_GPU_SHADERFORMAT_MSL) {
|
||||
info.format = SDL_GPU_SHADERFORMAT_MSL;
|
||||
info.code = testgpurender_msdf_frag_msl;
|
||||
info.code_size = testgpurender_msdf_frag_msl_len;
|
||||
} else {
|
||||
SDL_Log("No supported shader format found");
|
||||
return false;
|
||||
}
|
||||
info.num_samplers = 1;
|
||||
info.num_uniform_buffers = 1;
|
||||
info.stage = SDL_GPU_SHADERSTAGE_FRAGMENT;
|
||||
shader = SDL_CreateGPUShader(device, &info);
|
||||
if (!shader) {
|
||||
SDL_Log("Couldn't create shader: %s", SDL_GetError());
|
||||
return false;
|
||||
}
|
||||
|
||||
SDL_INIT_INTERFACE(&desc);
|
||||
desc.fragment_shader = shader;
|
||||
render_state = SDL_CreateGPURenderState(renderer, &desc);
|
||||
if (!render_state) {
|
||||
SDL_Log("Couldn't create render state: %s", SDL_GetError());
|
||||
return false;
|
||||
}
|
||||
|
||||
SDL_zero(uniforms);
|
||||
uniforms.distance_field_range = DISTANCE_FIELD_RANGE;
|
||||
uniforms.texture_width = (float)font_texture->w;
|
||||
uniforms.texture_height = (float)font_texture->h;
|
||||
if (!SDL_SetGPURenderStateFragmentUniforms(render_state, 0, &uniforms, sizeof(uniforms))) {
|
||||
SDL_Log("Couldn't set uniform data: %s", SDL_GetError());
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void QuitGPURenderState(void)
|
||||
{
|
||||
if (render_state) {
|
||||
SDL_DestroyGPURenderState(render_state);
|
||||
render_state = NULL;
|
||||
}
|
||||
if (shader) {
|
||||
SDL_ReleaseGPUShader(device, shader);
|
||||
shader = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* This function runs once at startup. */
|
||||
SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
|
||||
{
|
||||
const char *description = "GPU render MSDF example";
|
||||
|
||||
SDL_SetAppMetadata(description, "1.0", "com.example.testgpurender_msdf");
|
||||
|
||||
if (!SDL_Init(SDL_INIT_VIDEO)) {
|
||||
SDL_Log("Couldn't initialize SDL: %s", SDL_GetError());
|
||||
return SDL_APP_FAILURE;
|
||||
}
|
||||
|
||||
window = SDL_CreateWindow(description, 640, 480, 0);
|
||||
if (!window) {
|
||||
SDL_Log("Couldn't create window: %s", SDL_GetError());
|
||||
return SDL_APP_FAILURE;
|
||||
}
|
||||
|
||||
renderer = SDL_CreateRenderer(window, "gpu");
|
||||
if (!renderer) {
|
||||
SDL_Log("Couldn't create renderer: %s", SDL_GetError());
|
||||
return SDL_APP_FAILURE;
|
||||
}
|
||||
SDL_SetRenderVSync(renderer, 1);
|
||||
|
||||
if (!LoadFontTexture() || !LoadFontLayout()) {
|
||||
return SDL_APP_FAILURE;
|
||||
}
|
||||
|
||||
if (!InitGPURenderState()) {
|
||||
return SDL_APP_FAILURE;
|
||||
}
|
||||
|
||||
return SDL_APP_CONTINUE; /* carry on with the program! */
|
||||
}
|
||||
|
||||
/* This function runs when a new event (mouse input, keypresses, etc) occurs. */
|
||||
SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event)
|
||||
{
|
||||
if (event->type == SDL_EVENT_QUIT ||
|
||||
(event->type == SDL_EVENT_KEY_DOWN && event->key.key == SDLK_ESCAPE)) {
|
||||
return SDL_APP_SUCCESS; /* end the program, reporting success to the OS. */
|
||||
}
|
||||
return SDL_APP_CONTINUE; /* carry on with the program! */
|
||||
}
|
||||
|
||||
/* This function runs once per frame, and is the heart of the program. */
|
||||
SDL_AppResult SDL_AppIterate(void *appstate)
|
||||
{
|
||||
const char *text = "Hello world!";
|
||||
float text_width;
|
||||
float text_height;
|
||||
float x, y;
|
||||
int output_width, output_height;
|
||||
|
||||
SDL_SetRenderDrawColor(renderer, 255, 255, 255, SDL_ALPHA_OPAQUE);
|
||||
SDL_RenderClear(renderer);
|
||||
|
||||
text_height = 72.0f;
|
||||
text_width = MeasureText(text, text_height);
|
||||
SDL_GetCurrentRenderOutputSize(renderer, &output_width, &output_height);
|
||||
x = (output_width - text_width) / 2;
|
||||
y = (output_height - text_height) / 2;
|
||||
SDL_SetRenderGPUState(renderer, render_state);
|
||||
RenderText("Hello World!", text_height, x, y);
|
||||
SDL_SetRenderGPUState(renderer, NULL);
|
||||
|
||||
SDL_RenderPresent(renderer);
|
||||
|
||||
return SDL_APP_CONTINUE; /* carry on with the program! */
|
||||
}
|
||||
|
||||
/* This function runs once at shutdown. */
|
||||
void SDL_AppQuit(void *appstate, SDL_AppResult result)
|
||||
{
|
||||
/* SDL will clean up the window/renderer for us. */
|
||||
QuitGPURenderState();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,399 @@
|
||||
static const unsigned char testgpurender_msdf_frag_dxil[] = {
|
||||
0x44, 0x58, 0x42, 0x43, 0x2e, 0x49, 0xe7, 0xd0, 0x3a, 0xbb, 0xb2, 0xf2,
|
||||
0x7d, 0x23, 0x3a, 0x6b, 0x9a, 0xa6, 0x80, 0x0a, 0x01, 0x00, 0x00, 0x00,
|
||||
0x88, 0x12, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00,
|
||||
0x4c, 0x00, 0x00, 0x00, 0xa8, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00,
|
||||
0xf0, 0x01, 0x00, 0x00, 0xa0, 0x09, 0x00, 0x00, 0xbc, 0x09, 0x00, 0x00,
|
||||
0x53, 0x46, 0x49, 0x30, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x31, 0x54, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0x00, 0x00, 0x00,
|
||||
0x4f, 0x53, 0x47, 0x31, 0x34, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x53, 0x56, 0x5f, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x00, 0x00, 0x00,
|
||||
0x50, 0x53, 0x56, 0x30, 0x04, 0x01, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
|
||||
0x00, 0x00, 0x00, 0x00, 0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x13, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x18, 0x00, 0x00, 0x00, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52,
|
||||
0x44, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0x6d,
|
||||
0x61, 0x69, 0x6e, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x44, 0x00, 0x03, 0x02, 0x00, 0x00,
|
||||
0x0a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x42, 0x00,
|
||||
0x03, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x44, 0x10, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
|
||||
0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x53, 0x54, 0x41, 0x54, 0xa8, 0x07, 0x00, 0x00,
|
||||
0x60, 0x00, 0x00, 0x00, 0xea, 0x01, 0x00, 0x00, 0x44, 0x58, 0x49, 0x4c,
|
||||
0x00, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x90, 0x07, 0x00, 0x00,
|
||||
0x42, 0x43, 0xc0, 0xde, 0x21, 0x0c, 0x00, 0x00, 0xe1, 0x01, 0x00, 0x00,
|
||||
0x0b, 0x82, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00,
|
||||
0x07, 0x81, 0x23, 0x91, 0x41, 0xc8, 0x04, 0x49, 0x06, 0x10, 0x32, 0x39,
|
||||
0x92, 0x01, 0x84, 0x0c, 0x25, 0x05, 0x08, 0x19, 0x1e, 0x04, 0x8b, 0x62,
|
||||
0x80, 0x18, 0x45, 0x02, 0x42, 0x92, 0x0b, 0x42, 0xc4, 0x10, 0x32, 0x14,
|
||||
0x38, 0x08, 0x18, 0x4b, 0x0a, 0x32, 0x62, 0x88, 0x48, 0x90, 0x14, 0x20,
|
||||
0x43, 0x46, 0x88, 0xa5, 0x00, 0x19, 0x32, 0x42, 0xe4, 0x48, 0x0e, 0x90,
|
||||
0x11, 0x23, 0xc4, 0x50, 0x41, 0x51, 0x81, 0x8c, 0xe1, 0x83, 0xe5, 0x8a,
|
||||
0x04, 0x31, 0x46, 0x06, 0x51, 0x18, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
|
||||
0x1b, 0x8c, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x40, 0x02, 0xa8, 0x0d,
|
||||
0x84, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x20, 0x6d, 0x30, 0x86, 0xff,
|
||||
0xff, 0xff, 0xff, 0x1f, 0x00, 0x09, 0xa8, 0x00, 0x49, 0x18, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x13, 0x82, 0x60, 0x42, 0x20, 0x4c, 0x08, 0x06,
|
||||
0x00, 0x00, 0x00, 0x00, 0x89, 0x20, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00,
|
||||
0x32, 0x22, 0x88, 0x09, 0x20, 0x64, 0x85, 0x04, 0x13, 0x23, 0xa4, 0x84,
|
||||
0x04, 0x13, 0x23, 0xe3, 0x84, 0xa1, 0x90, 0x14, 0x12, 0x4c, 0x8c, 0x8c,
|
||||
0x0b, 0x84, 0xc4, 0x4c, 0x10, 0x98, 0xc1, 0x08, 0x40, 0x09, 0x00, 0x0a,
|
||||
0x66, 0x00, 0xe6, 0x08, 0xc0, 0x60, 0x8e, 0x00, 0x29, 0xc6, 0x40, 0x10,
|
||||
0x44, 0x41, 0x90, 0x51, 0x0c, 0x80, 0x20, 0x88, 0x62, 0x20, 0xe4, 0xa6,
|
||||
0xe1, 0xf2, 0x27, 0xec, 0x21, 0x24, 0x7f, 0x25, 0xa4, 0x95, 0x98, 0xfc,
|
||||
0xe2, 0xb6, 0x51, 0x31, 0x0c, 0xc3, 0x40, 0x50, 0x71, 0xcf, 0x70, 0xf9,
|
||||
0x13, 0xf6, 0x10, 0x92, 0x1f, 0x02, 0xcd, 0xb0, 0x10, 0x28, 0x58, 0x0a,
|
||||
0xa3, 0x10, 0x0c, 0x33, 0x0c, 0xc3, 0x40, 0x10, 0xc4, 0x40, 0x4d, 0x21,
|
||||
0x06, 0x62, 0x18, 0xe8, 0x29, 0xc6, 0x40, 0x0c, 0xc3, 0x30, 0x50, 0x54,
|
||||
0x86, 0x81, 0x18, 0x68, 0x3a, 0x6a, 0xb8, 0xfc, 0x09, 0x7b, 0x08, 0xc9,
|
||||
0xe7, 0x36, 0xaa, 0x58, 0x89, 0xc9, 0x2f, 0x6e, 0x1b, 0x11, 0xc3, 0x30,
|
||||
0x0c, 0x85, 0xa8, 0x08, 0x86, 0x20, 0x6b, 0x8e, 0x20, 0x28, 0x06, 0x43,
|
||||
0x14, 0x04, 0x81, 0x51, 0x36, 0x10, 0x30, 0x8c, 0x40, 0x0c, 0x33, 0xb5,
|
||||
0xc1, 0x38, 0xb0, 0x43, 0x38, 0xcc, 0xc3, 0x3c, 0xb8, 0x01, 0x2d, 0x94,
|
||||
0x03, 0x3e, 0xd0, 0x43, 0x3d, 0xc8, 0x43, 0x39, 0xc8, 0x01, 0x29, 0xf0,
|
||||
0x81, 0x3d, 0x94, 0xc3, 0x38, 0xd0, 0xc3, 0x3b, 0xc8, 0x03, 0x1f, 0x98,
|
||||
0x03, 0x3b, 0xbc, 0x43, 0x38, 0xd0, 0x03, 0x1b, 0x80, 0x01, 0x1d, 0xf8,
|
||||
0x01, 0x18, 0xf8, 0x81, 0x1e, 0xe8, 0x41, 0x3b, 0xa4, 0x03, 0x3c, 0xcc,
|
||||
0xc3, 0x2f, 0xd0, 0x43, 0x3e, 0xc0, 0x43, 0x39, 0xa0, 0x80, 0x98, 0x49,
|
||||
0x0c, 0xc6, 0x81, 0x1d, 0xc2, 0x61, 0x1e, 0xe6, 0xc1, 0x0d, 0x68, 0xa1,
|
||||
0x1c, 0xf0, 0x81, 0x1e, 0xea, 0x41, 0x1e, 0xca, 0x41, 0x0e, 0x48, 0x81,
|
||||
0x0f, 0xec, 0xa1, 0x1c, 0xc6, 0x81, 0x1e, 0xde, 0x41, 0x1e, 0xf8, 0xc0,
|
||||
0x1c, 0xd8, 0xe1, 0x1d, 0xc2, 0x81, 0x1e, 0xd8, 0x00, 0x0c, 0xe8, 0xc0,
|
||||
0x0f, 0xc0, 0xc0, 0x0f, 0x90, 0xc0, 0x75, 0xe4, 0x0d, 0x23, 0x08, 0xc3,
|
||||
0x31, 0x13, 0xf6, 0x10, 0x3f, 0xe7, 0x34, 0x13, 0x71, 0x4d, 0x48, 0x18,
|
||||
0x40, 0x0a, 0x6f, 0x92, 0xa6, 0x88, 0x12, 0x26, 0x9f, 0x05, 0x98, 0x67,
|
||||
0x21, 0x22, 0x76, 0x02, 0x26, 0x02, 0x05, 0x04, 0x8d, 0x89, 0x40, 0x00,
|
||||
0x13, 0x14, 0x72, 0xc0, 0x87, 0x74, 0x60, 0x87, 0x36, 0x68, 0x87, 0x79,
|
||||
0x68, 0x03, 0x72, 0xc0, 0x87, 0x0d, 0xaf, 0x50, 0x0e, 0x6d, 0xd0, 0x0e,
|
||||
0x7a, 0x50, 0x0e, 0x6d, 0x00, 0x0f, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07,
|
||||
0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x71, 0xa0, 0x07, 0x73, 0x20, 0x07,
|
||||
0x6d, 0x90, 0x0e, 0x78, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e,
|
||||
0x71, 0x60, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0, 0x06, 0xe9, 0x30, 0x07,
|
||||
0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x76, 0x40, 0x07,
|
||||
0x7a, 0x60, 0x07, 0x74, 0xd0, 0x06, 0xe6, 0x10, 0x07, 0x76, 0xa0, 0x07,
|
||||
0x73, 0x20, 0x07, 0x6d, 0x60, 0x0e, 0x73, 0x20, 0x07, 0x7a, 0x30, 0x07,
|
||||
0x72, 0xd0, 0x06, 0xe6, 0x60, 0x07, 0x74, 0xa0, 0x07, 0x76, 0x40, 0x07,
|
||||
0x6d, 0xe0, 0x0e, 0x78, 0xa0, 0x07, 0x71, 0x60, 0x07, 0x7a, 0x30, 0x07,
|
||||
0x72, 0xa0, 0x07, 0x76, 0x40, 0x07, 0x43, 0x9e, 0x00, 0x08, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0x3c, 0x06, 0x10, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x79, 0x10, 0x20,
|
||||
0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0xf2, 0x34,
|
||||
0x40, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xe4,
|
||||
0x79, 0x80, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60,
|
||||
0xc8, 0x13, 0x01, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0xc0, 0x90, 0x67, 0x02, 0x02, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x80, 0x21, 0x8f, 0x05, 0x04, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x43, 0x9e, 0x0c, 0x08, 0x80, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0xb2, 0x40, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00,
|
||||
0x32, 0x1e, 0x98, 0x18, 0x19, 0x11, 0x4c, 0x90, 0x8c, 0x09, 0x26, 0x47,
|
||||
0xc6, 0x04, 0x43, 0x22, 0x4a, 0x60, 0x04, 0xa0, 0x18, 0x8a, 0xa0, 0x24,
|
||||
0xca, 0xa0, 0x30, 0xca, 0xa1, 0x10, 0x4a, 0xa3, 0x3c, 0xca, 0xa5, 0xc4,
|
||||
0xa8, 0x28, 0x89, 0x11, 0x80, 0x22, 0x28, 0x84, 0x02, 0x21, 0xac, 0x06,
|
||||
0xe8, 0x9b, 0x01, 0xa0, 0x70, 0x06, 0x80, 0xc4, 0x19, 0x00, 0x22, 0x67,
|
||||
0x00, 0xa8, 0x1c, 0x0b, 0x31, 0x88, 0x40, 0x20, 0x10, 0x04, 0x01, 0x00,
|
||||
0x79, 0x18, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x1a, 0x03, 0x4c, 0x90,
|
||||
0x46, 0x02, 0x13, 0xc4, 0x8e, 0x0c, 0x6f, 0xec, 0xed, 0x4d, 0x0c, 0x24,
|
||||
0xc6, 0x05, 0xc7, 0x45, 0xa6, 0x06, 0x46, 0xc6, 0x05, 0x07, 0x04, 0x45,
|
||||
0x8c, 0xe6, 0x26, 0x26, 0x06, 0x67, 0x26, 0xa7, 0x2c, 0x65, 0x43, 0x10,
|
||||
0x4c, 0x10, 0x88, 0x64, 0x82, 0x40, 0x28, 0x1b, 0x84, 0x81, 0xd8, 0x20,
|
||||
0x10, 0x04, 0x05, 0xb8, 0xb9, 0x09, 0x02, 0xb1, 0x6c, 0x18, 0x0e, 0x84,
|
||||
0x98, 0x20, 0x7c, 0x1c, 0x93, 0xba, 0x2f, 0xba, 0x32, 0x3c, 0xba, 0x3a,
|
||||
0xb9, 0xb2, 0x09, 0x02, 0xc1, 0x4c, 0x10, 0x88, 0x66, 0x83, 0x40, 0x34,
|
||||
0x1b, 0x12, 0x42, 0x59, 0x18, 0x62, 0x60, 0x08, 0x67, 0x43, 0xf0, 0x4c,
|
||||
0x10, 0xc4, 0xc0, 0x23, 0x43, 0x97, 0x07, 0x57, 0xf6, 0x35, 0xf4, 0xe6,
|
||||
0x46, 0x57, 0x86, 0x47, 0x37, 0x41, 0x20, 0x9c, 0x09, 0x02, 0xf1, 0x6c,
|
||||
0x40, 0x88, 0x48, 0x9a, 0x88, 0x81, 0x02, 0x36, 0x04, 0xd5, 0x04, 0x81,
|
||||
0x0c, 0x3e, 0x26, 0x75, 0x5f, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72,
|
||||
0x1b, 0x10, 0xe2, 0xc2, 0x18, 0x62, 0x20, 0x80, 0x0d, 0x41, 0xb6, 0x81,
|
||||
0x80, 0x00, 0x4b, 0x9b, 0x20, 0x84, 0x41, 0x47, 0x6e, 0xe8, 0xcd, 0x8d,
|
||||
0xae, 0x0c, 0x8f, 0xee, 0x8b, 0x2c, 0x6d, 0x8e, 0x2e, 0xcc, 0x6d, 0xac,
|
||||
0xec, 0xcb, 0x2c, 0xad, 0x8c, 0x8d, 0xec, 0x4b, 0x2e, 0xcc, 0xed, 0xac,
|
||||
0x6c, 0x82, 0x40, 0x40, 0x13, 0x04, 0x6c, 0xdb, 0x80, 0x20, 0xdd, 0x44,
|
||||
0x78, 0x4d, 0xf3, 0x91, 0x1a, 0x7a, 0x73, 0xa3, 0x2b, 0xc3, 0xa3, 0xfb,
|
||||
0xa2, 0x2b, 0xc3, 0xa3, 0xab, 0x93, 0x2b, 0xfb, 0x9a, 0x4b, 0xd3, 0x2b,
|
||||
0x9b, 0x20, 0x10, 0xd1, 0x04, 0x81, 0x90, 0x36, 0x28, 0x48, 0x18, 0x4c,
|
||||
0x62, 0xe0, 0x35, 0xcd, 0x37, 0x06, 0xcc, 0x86, 0x81, 0x02, 0x03, 0x32,
|
||||
0xd8, 0x30, 0x10, 0x5c, 0x19, 0x4c, 0x10, 0x04, 0x60, 0x03, 0xb0, 0x61,
|
||||
0x20, 0xd0, 0x00, 0x0d, 0x36, 0x04, 0x69, 0xb0, 0x61, 0x18, 0xce, 0x40,
|
||||
0x0d, 0x26, 0x08, 0x65, 0x00, 0x06, 0x1b, 0x02, 0x36, 0x20, 0xd1, 0x16,
|
||||
0x96, 0xe6, 0x46, 0x84, 0xaa, 0x08, 0x6b, 0xe8, 0xe9, 0x49, 0x8a, 0x68,
|
||||
0x82, 0x50, 0x58, 0x13, 0x84, 0xe2, 0xda, 0x10, 0x10, 0x13, 0x84, 0x02,
|
||||
0x9b, 0x20, 0x14, 0xd9, 0x04, 0x81, 0x98, 0x36, 0x08, 0x53, 0x1d, 0x6c,
|
||||
0x58, 0x88, 0x37, 0x80, 0x83, 0x38, 0x90, 0x83, 0x39, 0x18, 0xe8, 0x80,
|
||||
0x88, 0x03, 0x3b, 0xd8, 0x10, 0x0c, 0x1b, 0x84, 0x69, 0xda, 0xb0, 0x0c,
|
||||
0x6f, 0x00, 0x07, 0x71, 0x80, 0x07, 0x73, 0x30, 0xcc, 0xc1, 0x10, 0x07,
|
||||
0x79, 0xb0, 0x41, 0xb8, 0x03, 0x3d, 0x60, 0x32, 0x65, 0xf5, 0x45, 0x15,
|
||||
0x26, 0x77, 0x56, 0x46, 0x37, 0x41, 0x28, 0xb4, 0x0d, 0x0b, 0xc1, 0x07,
|
||||
0x70, 0xd0, 0x07, 0x72, 0x10, 0x07, 0x03, 0x1d, 0x10, 0x71, 0x60, 0x07,
|
||||
0x1b, 0x02, 0x3f, 0xd8, 0x30, 0xec, 0xc1, 0x1f, 0x00, 0x1b, 0x8a, 0x33,
|
||||
0x70, 0x03, 0x50, 0xd8, 0x00, 0x1a, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x73,
|
||||
0x13, 0x04, 0x82, 0x62, 0x91, 0xe6, 0x36, 0x47, 0x37, 0x37, 0x41, 0x20,
|
||||
0x2a, 0x1a, 0x73, 0x69, 0x67, 0x5f, 0x6c, 0x64, 0x34, 0xe6, 0xd2, 0xce,
|
||||
0xbe, 0xe6, 0xe8, 0x88, 0xd0, 0x95, 0xe1, 0x7d, 0xb9, 0xbd, 0xc9, 0xb5,
|
||||
0x6d, 0x50, 0x44, 0x61, 0x14, 0x48, 0xa1, 0x14, 0x4c, 0x01, 0x39, 0x05,
|
||||
0x31, 0x40, 0x85, 0xa1, 0x0a, 0x1b, 0x9b, 0x5d, 0x9b, 0x4b, 0x1a, 0x59,
|
||||
0x99, 0x1b, 0xdd, 0x94, 0x20, 0xa8, 0x42, 0x86, 0xe7, 0x62, 0x57, 0x26,
|
||||
0x37, 0x97, 0xf6, 0xe6, 0x36, 0x25, 0x20, 0x9a, 0x90, 0xe1, 0xb9, 0xd8,
|
||||
0x85, 0xb1, 0xd9, 0x95, 0xc9, 0x4d, 0x09, 0x8a, 0x3a, 0x64, 0x78, 0x2e,
|
||||
0x73, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53,
|
||||
0x02, 0xa4, 0x0c, 0x19, 0x9e, 0x8b, 0x5c, 0xd9, 0xdc, 0x5b, 0x9d, 0xdc,
|
||||
0x58, 0xd9, 0xdc, 0x94, 0x40, 0xab, 0x44, 0x86, 0xe7, 0x42, 0x97, 0x07,
|
||||
0x57, 0x16, 0xe4, 0xe6, 0xf6, 0x46, 0x17, 0x46, 0x97, 0xf6, 0xe6, 0x36,
|
||||
0x37, 0x45, 0x28, 0x03, 0x35, 0xa8, 0x43, 0x86, 0xe7, 0x62, 0x97, 0x56,
|
||||
0x76, 0x97, 0x44, 0x36, 0x45, 0x17, 0x46, 0x57, 0x36, 0x25, 0x60, 0x83,
|
||||
0x3a, 0x64, 0x78, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69,
|
||||
0x6e, 0x74, 0x73, 0x53, 0x02, 0x50, 0xe8, 0x42, 0x86, 0xe7, 0x32, 0xf6,
|
||||
0x56, 0xe7, 0x46, 0x57, 0x26, 0x37, 0x37, 0x25, 0x40, 0x05, 0x00, 0x00,
|
||||
0x79, 0x18, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x33, 0x08, 0x80, 0x1c,
|
||||
0xc4, 0xe1, 0x1c, 0x66, 0x14, 0x01, 0x3d, 0x88, 0x43, 0x38, 0x84, 0xc3,
|
||||
0x8c, 0x42, 0x80, 0x07, 0x79, 0x78, 0x07, 0x73, 0x98, 0x71, 0x0c, 0xe6,
|
||||
0x00, 0x0f, 0xed, 0x10, 0x0e, 0xf4, 0x80, 0x0e, 0x33, 0x0c, 0x42, 0x1e,
|
||||
0xc2, 0xc1, 0x1d, 0xce, 0xa1, 0x1c, 0x66, 0x30, 0x05, 0x3d, 0x88, 0x43,
|
||||
0x38, 0x84, 0x83, 0x1b, 0xcc, 0x03, 0x3d, 0xc8, 0x43, 0x3d, 0x8c, 0x03,
|
||||
0x3d, 0xcc, 0x78, 0x8c, 0x74, 0x70, 0x07, 0x7b, 0x08, 0x07, 0x79, 0x48,
|
||||
0x87, 0x70, 0x70, 0x07, 0x7a, 0x70, 0x03, 0x76, 0x78, 0x87, 0x70, 0x20,
|
||||
0x87, 0x19, 0xcc, 0x11, 0x0e, 0xec, 0x90, 0x0e, 0xe1, 0x30, 0x0f, 0x6e,
|
||||
0x30, 0x0f, 0xe3, 0xf0, 0x0e, 0xf0, 0x50, 0x0e, 0x33, 0x10, 0xc4, 0x1d,
|
||||
0xde, 0x21, 0x1c, 0xd8, 0x21, 0x1d, 0xc2, 0x61, 0x1e, 0x66, 0x30, 0x89,
|
||||
0x3b, 0xbc, 0x83, 0x3b, 0xd0, 0x43, 0x39, 0xb4, 0x03, 0x3c, 0xbc, 0x83,
|
||||
0x3c, 0x84, 0x03, 0x3b, 0xcc, 0xf0, 0x14, 0x76, 0x60, 0x07, 0x7b, 0x68,
|
||||
0x07, 0x37, 0x68, 0x87, 0x72, 0x68, 0x07, 0x37, 0x80, 0x87, 0x70, 0x90,
|
||||
0x87, 0x70, 0x60, 0x07, 0x76, 0x28, 0x07, 0x76, 0xf8, 0x05, 0x76, 0x78,
|
||||
0x87, 0x77, 0x80, 0x87, 0x5f, 0x08, 0x87, 0x71, 0x18, 0x87, 0x72, 0x98,
|
||||
0x87, 0x79, 0x98, 0x81, 0x2c, 0xee, 0xf0, 0x0e, 0xee, 0xe0, 0x0e, 0xf5,
|
||||
0xc0, 0x0e, 0xec, 0x30, 0x03, 0x62, 0xc8, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c,
|
||||
0xcc, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c, 0xdc, 0x61, 0x1c, 0xca, 0x21, 0x1c,
|
||||
0xc4, 0x81, 0x1d, 0xca, 0x61, 0x06, 0xd6, 0x90, 0x43, 0x39, 0xc8, 0x43,
|
||||
0x39, 0x98, 0x43, 0x39, 0xc8, 0x43, 0x39, 0xb8, 0xc3, 0x38, 0x94, 0x43,
|
||||
0x38, 0x88, 0x03, 0x3b, 0x94, 0xc3, 0x2f, 0xbc, 0x83, 0x3c, 0xfc, 0x82,
|
||||
0x3b, 0xd4, 0x03, 0x3b, 0xb0, 0xc3, 0x8c, 0xc8, 0x21, 0x07, 0x7c, 0x70,
|
||||
0x03, 0x72, 0x10, 0x87, 0x73, 0x70, 0x03, 0x7b, 0x08, 0x07, 0x79, 0x60,
|
||||
0x87, 0x70, 0xc8, 0x87, 0x77, 0xa8, 0x07, 0x7a, 0x98, 0x81, 0x3c, 0xe4,
|
||||
0x80, 0x0f, 0x6e, 0x40, 0x0f, 0xe5, 0xd0, 0x0e, 0xf0, 0x00, 0x00, 0x00,
|
||||
0x71, 0x20, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x46, 0x00, 0x0d, 0x97,
|
||||
0xef, 0x3c, 0x7e, 0x80, 0x34, 0x40, 0x84, 0xf9, 0xc5, 0x6d, 0xdb, 0xc1,
|
||||
0x36, 0x5c, 0xbe, 0xf3, 0xf8, 0x42, 0x40, 0x15, 0x05, 0x11, 0x95, 0x0e,
|
||||
0x30, 0x94, 0x84, 0x01, 0x08, 0x98, 0x5f, 0xdc, 0xb6, 0x21, 0x48, 0xc3,
|
||||
0xe5, 0x3b, 0x8f, 0x2f, 0x44, 0x04, 0x30, 0x11, 0x21, 0xd0, 0x0c, 0x0b,
|
||||
0x61, 0x05, 0xce, 0x70, 0xf9, 0xce, 0xe3, 0x0f, 0xce, 0x64, 0xfb, 0xc5,
|
||||
0x6d, 0x5b, 0xc0, 0x34, 0x5c, 0xbe, 0xf3, 0xf8, 0x8b, 0x03, 0x0c, 0x62,
|
||||
0xf3, 0x50, 0x93, 0x5f, 0xdc, 0xb6, 0x0d, 0x40, 0xc3, 0xe5, 0x3b, 0x8f,
|
||||
0x2f, 0x01, 0xcc, 0xb3, 0x10, 0x7e, 0x71, 0xdb, 0x26, 0x50, 0x0d, 0x97,
|
||||
0xef, 0x3c, 0xbe, 0x34, 0x39, 0x11, 0x81, 0x52, 0xd3, 0x43, 0x4d, 0x7e,
|
||||
0x71, 0xdb, 0x66, 0xf0, 0x0c, 0x97, 0xef, 0x3c, 0x3e, 0xd5, 0x00, 0x11,
|
||||
0xe6, 0x17, 0xb7, 0x6d, 0x00, 0x04, 0x03, 0x20, 0x0d, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x48, 0x41, 0x53, 0x48, 0x14, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0xa0, 0x40, 0x54, 0xe9, 0xac, 0xdc, 0xa5, 0x12,
|
||||
0x84, 0x83, 0x18, 0xdf, 0x37, 0xc0, 0x99, 0x88, 0x44, 0x58, 0x49, 0x4c,
|
||||
0xc4, 0x08, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x31, 0x02, 0x00, 0x00,
|
||||
0x44, 0x58, 0x49, 0x4c, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||
0xac, 0x08, 0x00, 0x00, 0x42, 0x43, 0xc0, 0xde, 0x21, 0x0c, 0x00, 0x00,
|
||||
0x28, 0x02, 0x00, 0x00, 0x0b, 0x82, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x13, 0x00, 0x00, 0x00, 0x07, 0x81, 0x23, 0x91, 0x41, 0xc8, 0x04, 0x49,
|
||||
0x06, 0x10, 0x32, 0x39, 0x92, 0x01, 0x84, 0x0c, 0x25, 0x05, 0x08, 0x19,
|
||||
0x1e, 0x04, 0x8b, 0x62, 0x80, 0x18, 0x45, 0x02, 0x42, 0x92, 0x0b, 0x42,
|
||||
0xc4, 0x10, 0x32, 0x14, 0x38, 0x08, 0x18, 0x4b, 0x0a, 0x32, 0x62, 0x88,
|
||||
0x48, 0x90, 0x14, 0x20, 0x43, 0x46, 0x88, 0xa5, 0x00, 0x19, 0x32, 0x42,
|
||||
0xe4, 0x48, 0x0e, 0x90, 0x11, 0x23, 0xc4, 0x50, 0x41, 0x51, 0x81, 0x8c,
|
||||
0xe1, 0x83, 0xe5, 0x8a, 0x04, 0x31, 0x46, 0x06, 0x51, 0x18, 0x00, 0x00,
|
||||
0x08, 0x00, 0x00, 0x00, 0x1b, 0x8c, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x07,
|
||||
0x40, 0x02, 0xa8, 0x0d, 0x84, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x20,
|
||||
0x6d, 0x30, 0x86, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x09, 0xa8, 0x00,
|
||||
0x49, 0x18, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x13, 0x82, 0x60, 0x42,
|
||||
0x20, 0x4c, 0x08, 0x06, 0x00, 0x00, 0x00, 0x00, 0x89, 0x20, 0x00, 0x00,
|
||||
0x54, 0x00, 0x00, 0x00, 0x32, 0x22, 0x88, 0x09, 0x20, 0x64, 0x85, 0x04,
|
||||
0x13, 0x23, 0xa4, 0x84, 0x04, 0x13, 0x23, 0xe3, 0x84, 0xa1, 0x90, 0x14,
|
||||
0x12, 0x4c, 0x8c, 0x8c, 0x0b, 0x84, 0xc4, 0x4c, 0x10, 0x98, 0xc1, 0x08,
|
||||
0x40, 0x09, 0x00, 0x0a, 0x66, 0x00, 0xe6, 0x08, 0xc0, 0x60, 0x8e, 0x00,
|
||||
0x29, 0xc6, 0x40, 0x10, 0x44, 0x41, 0x90, 0x51, 0x0c, 0x80, 0x20, 0x88,
|
||||
0x62, 0x20, 0xe4, 0xa6, 0xe1, 0xf2, 0x27, 0xec, 0x21, 0x24, 0x7f, 0x25,
|
||||
0xa4, 0x95, 0x98, 0xfc, 0xe2, 0xb6, 0x51, 0x31, 0x0c, 0xc3, 0x40, 0x50,
|
||||
0x71, 0xcf, 0x70, 0xf9, 0x13, 0xf6, 0x10, 0x92, 0x1f, 0x02, 0xcd, 0xb0,
|
||||
0x10, 0x28, 0x58, 0x0a, 0xa3, 0x10, 0x0c, 0x33, 0x0c, 0xc3, 0x40, 0x10,
|
||||
0xc4, 0x40, 0x4d, 0x21, 0x06, 0x62, 0x18, 0xe8, 0x29, 0xc6, 0x40, 0x0c,
|
||||
0xc3, 0x30, 0x50, 0x54, 0x86, 0x81, 0x18, 0x68, 0x3a, 0x6a, 0xb8, 0xfc,
|
||||
0x09, 0x7b, 0x08, 0xc9, 0xe7, 0x36, 0xaa, 0x58, 0x89, 0xc9, 0x2f, 0x6e,
|
||||
0x1b, 0x11, 0xc3, 0x30, 0x0c, 0x85, 0xa8, 0x08, 0x86, 0x20, 0x6b, 0x8e,
|
||||
0x20, 0x28, 0x06, 0x43, 0x14, 0x04, 0x81, 0x51, 0x36, 0x10, 0x30, 0x8c,
|
||||
0x40, 0x0c, 0x33, 0xb5, 0xc1, 0x38, 0xb0, 0x43, 0x38, 0xcc, 0xc3, 0x3c,
|
||||
0xb8, 0x01, 0x2d, 0x94, 0x03, 0x3e, 0xd0, 0x43, 0x3d, 0xc8, 0x43, 0x39,
|
||||
0xc8, 0x01, 0x29, 0xf0, 0x81, 0x3d, 0x94, 0xc3, 0x38, 0xd0, 0xc3, 0x3b,
|
||||
0xc8, 0x03, 0x1f, 0x98, 0x03, 0x3b, 0xbc, 0x43, 0x38, 0xd0, 0x03, 0x1b,
|
||||
0x80, 0x01, 0x1d, 0xf8, 0x01, 0x18, 0xf8, 0x81, 0x1e, 0xe8, 0x41, 0x3b,
|
||||
0xa4, 0x03, 0x3c, 0xcc, 0xc3, 0x2f, 0xd0, 0x43, 0x3e, 0xc0, 0x43, 0x39,
|
||||
0xa0, 0x80, 0x98, 0x49, 0x0c, 0xc6, 0x81, 0x1d, 0xc2, 0x61, 0x1e, 0xe6,
|
||||
0xc1, 0x0d, 0x68, 0xa1, 0x1c, 0xf0, 0x81, 0x1e, 0xea, 0x41, 0x1e, 0xca,
|
||||
0x41, 0x0e, 0x48, 0x81, 0x0f, 0xec, 0xa1, 0x1c, 0xc6, 0x81, 0x1e, 0xde,
|
||||
0x41, 0x1e, 0xf8, 0xc0, 0x1c, 0xd8, 0xe1, 0x1d, 0xc2, 0x81, 0x1e, 0xd8,
|
||||
0x00, 0x0c, 0xe8, 0xc0, 0x0f, 0xc0, 0xc0, 0x0f, 0x90, 0xc0, 0x75, 0xe4,
|
||||
0x0d, 0x23, 0x08, 0xc3, 0x31, 0x13, 0xf6, 0x10, 0x3f, 0xe7, 0x34, 0x13,
|
||||
0x71, 0x4d, 0x48, 0x18, 0x40, 0x0a, 0x6f, 0x92, 0xa6, 0x88, 0x12, 0x26,
|
||||
0x9f, 0x05, 0x98, 0x67, 0x21, 0x22, 0x76, 0x02, 0x26, 0x02, 0x05, 0x04,
|
||||
0x8d, 0x89, 0x40, 0x00, 0x13, 0x14, 0x72, 0xc0, 0x87, 0x74, 0x60, 0x87,
|
||||
0x36, 0x68, 0x87, 0x79, 0x68, 0x03, 0x72, 0xc0, 0x87, 0x0d, 0xaf, 0x50,
|
||||
0x0e, 0x6d, 0xd0, 0x0e, 0x7a, 0x50, 0x0e, 0x6d, 0x00, 0x0f, 0x7a, 0x30,
|
||||
0x07, 0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x71, 0xa0,
|
||||
0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x78, 0xa0, 0x07, 0x73, 0x20,
|
||||
0x07, 0x6d, 0x90, 0x0e, 0x71, 0x60, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0,
|
||||
0x06, 0xe9, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90,
|
||||
0x0e, 0x76, 0x40, 0x07, 0x7a, 0x60, 0x07, 0x74, 0xd0, 0x06, 0xe6, 0x10,
|
||||
0x07, 0x76, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x60, 0x0e, 0x73, 0x20,
|
||||
0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0, 0x06, 0xe6, 0x60, 0x07, 0x74, 0xa0,
|
||||
0x07, 0x76, 0x40, 0x07, 0x6d, 0xe0, 0x0e, 0x78, 0xa0, 0x07, 0x71, 0x60,
|
||||
0x07, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x76, 0x40, 0x07, 0x43, 0x9e,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86,
|
||||
0x3c, 0x06, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x0c, 0x79, 0x10, 0x20, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x18, 0xf2, 0x34, 0x40, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x30, 0xe4, 0x79, 0x80, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x60, 0xc8, 0x13, 0x01, 0x01, 0x10, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0xc0, 0x90, 0x67, 0x02, 0x02, 0x20, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x21, 0x8f, 0x05, 0x04, 0xc0, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, 0x9e, 0x0c, 0x08, 0x80,
|
||||
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x40, 0x00, 0x00,
|
||||
0x0f, 0x00, 0x00, 0x00, 0x32, 0x1e, 0x98, 0x14, 0x19, 0x11, 0x4c, 0x90,
|
||||
0x8c, 0x09, 0x26, 0x47, 0xc6, 0x04, 0x43, 0x22, 0x4a, 0x60, 0x04, 0xa0,
|
||||
0x20, 0x8a, 0xa1, 0x08, 0x4a, 0xa2, 0x0c, 0x0a, 0xa3, 0x3c, 0xa8, 0x28,
|
||||
0x89, 0x11, 0x80, 0x22, 0x28, 0x84, 0x02, 0xa1, 0x6f, 0x06, 0x80, 0xc4,
|
||||
0x19, 0x00, 0x22, 0x67, 0x00, 0xa8, 0x1c, 0x0b, 0x31, 0x88, 0x40, 0x20,
|
||||
0x10, 0x04, 0x01, 0x00, 0x79, 0x18, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x00,
|
||||
0x1a, 0x03, 0x4c, 0x90, 0x46, 0x02, 0x13, 0xc4, 0x8e, 0x0c, 0x6f, 0xec,
|
||||
0xed, 0x4d, 0x0c, 0x24, 0xc6, 0x05, 0xc7, 0x45, 0xa6, 0x06, 0x46, 0xc6,
|
||||
0x05, 0x07, 0x04, 0x45, 0x8c, 0xe6, 0x26, 0x26, 0x06, 0x67, 0x26, 0xa7,
|
||||
0x2c, 0x65, 0x43, 0x10, 0x4c, 0x10, 0x88, 0x64, 0x82, 0x40, 0x28, 0x1b,
|
||||
0x84, 0x81, 0x98, 0x20, 0x10, 0xcb, 0x06, 0x61, 0x30, 0x28, 0xc0, 0xcd,
|
||||
0x4d, 0x10, 0x08, 0x66, 0xc3, 0x80, 0x24, 0xc4, 0x04, 0xe1, 0xbb, 0x08,
|
||||
0x4c, 0x10, 0x88, 0x66, 0x82, 0x40, 0x38, 0x1b, 0x04, 0xc2, 0xd9, 0x90,
|
||||
0x10, 0x0b, 0xd3, 0x10, 0x43, 0x43, 0x3c, 0x1b, 0x02, 0x68, 0x82, 0x20,
|
||||
0x06, 0xd8, 0x04, 0x81, 0x78, 0x26, 0x08, 0x04, 0xb4, 0x01, 0x21, 0x24,
|
||||
0x66, 0x22, 0x06, 0x0a, 0xd8, 0x10, 0x54, 0x13, 0x04, 0x32, 0xc8, 0x36,
|
||||
0x20, 0xc4, 0xc5, 0x34, 0xc4, 0x40, 0x00, 0x1b, 0x02, 0x6c, 0x03, 0x11,
|
||||
0x01, 0x56, 0x36, 0x41, 0x28, 0x03, 0x6d, 0x43, 0xb0, 0x4d, 0x10, 0x04,
|
||||
0x80, 0x44, 0x5b, 0x58, 0x9a, 0x1b, 0x11, 0xaa, 0x22, 0xac, 0xa1, 0xa7,
|
||||
0x27, 0x29, 0xa2, 0x09, 0x42, 0x21, 0x4d, 0x10, 0x8a, 0x69, 0x43, 0x40,
|
||||
0x4c, 0x10, 0x0a, 0x6a, 0x82, 0x50, 0x54, 0x13, 0x04, 0x22, 0xda, 0x20,
|
||||
0x4c, 0x65, 0xb0, 0x61, 0x21, 0x3e, 0x30, 0x08, 0x03, 0x31, 0x18, 0x83,
|
||||
0x81, 0x0c, 0x88, 0x30, 0x30, 0x83, 0x0d, 0xc1, 0xb0, 0x41, 0x98, 0xa6,
|
||||
0x0d, 0xcb, 0xf0, 0x81, 0x41, 0x18, 0xa0, 0xc1, 0x18, 0x0c, 0x63, 0x30,
|
||||
0x84, 0x41, 0x1a, 0x6c, 0x10, 0xce, 0x40, 0x0d, 0x98, 0x4c, 0x59, 0x7d,
|
||||
0x51, 0x85, 0xc9, 0x9d, 0x95, 0xd1, 0x4d, 0x10, 0x0a, 0x6b, 0xc3, 0x42,
|
||||
0xb0, 0x01, 0x18, 0xb4, 0x81, 0x18, 0x84, 0xc1, 0x40, 0x06, 0x44, 0x18,
|
||||
0x98, 0xc1, 0x86, 0xc0, 0x0d, 0x36, 0x0c, 0x6b, 0xf0, 0x06, 0xc0, 0x86,
|
||||
0xa2, 0xf3, 0xe0, 0x40, 0x03, 0xaa, 0xb0, 0xb1, 0xd9, 0xb5, 0xb9, 0xa4,
|
||||
0x91, 0x95, 0xb9, 0xd1, 0x4d, 0x09, 0x82, 0x2a, 0x64, 0x78, 0x2e, 0x76,
|
||||
0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x02, 0xa2, 0x09, 0x19, 0x9e,
|
||||
0x8b, 0x5d, 0x18, 0x9b, 0x5d, 0x99, 0xdc, 0x94, 0xc0, 0xa8, 0x43, 0x86,
|
||||
0xe7, 0x32, 0x87, 0x16, 0x46, 0x56, 0x26, 0xd7, 0xf4, 0x46, 0x56, 0xc6,
|
||||
0x36, 0x25, 0x48, 0xca, 0x90, 0xe1, 0xb9, 0xc8, 0x95, 0xcd, 0xbd, 0xd5,
|
||||
0xc9, 0x8d, 0x95, 0xcd, 0x4d, 0x09, 0xb2, 0x3a, 0x64, 0x78, 0x2e, 0x76,
|
||||
0x69, 0x65, 0x77, 0x49, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x82,
|
||||
0xad, 0x0e, 0x19, 0x9e, 0x4b, 0x99, 0x1b, 0x9d, 0x5c, 0x1e, 0xd4, 0x5b,
|
||||
0x9a, 0x1b, 0xdd, 0xdc, 0x94, 0x00, 0x0e, 0x00, 0x79, 0x18, 0x00, 0x00,
|
||||
0x4c, 0x00, 0x00, 0x00, 0x33, 0x08, 0x80, 0x1c, 0xc4, 0xe1, 0x1c, 0x66,
|
||||
0x14, 0x01, 0x3d, 0x88, 0x43, 0x38, 0x84, 0xc3, 0x8c, 0x42, 0x80, 0x07,
|
||||
0x79, 0x78, 0x07, 0x73, 0x98, 0x71, 0x0c, 0xe6, 0x00, 0x0f, 0xed, 0x10,
|
||||
0x0e, 0xf4, 0x80, 0x0e, 0x33, 0x0c, 0x42, 0x1e, 0xc2, 0xc1, 0x1d, 0xce,
|
||||
0xa1, 0x1c, 0x66, 0x30, 0x05, 0x3d, 0x88, 0x43, 0x38, 0x84, 0x83, 0x1b,
|
||||
0xcc, 0x03, 0x3d, 0xc8, 0x43, 0x3d, 0x8c, 0x03, 0x3d, 0xcc, 0x78, 0x8c,
|
||||
0x74, 0x70, 0x07, 0x7b, 0x08, 0x07, 0x79, 0x48, 0x87, 0x70, 0x70, 0x07,
|
||||
0x7a, 0x70, 0x03, 0x76, 0x78, 0x87, 0x70, 0x20, 0x87, 0x19, 0xcc, 0x11,
|
||||
0x0e, 0xec, 0x90, 0x0e, 0xe1, 0x30, 0x0f, 0x6e, 0x30, 0x0f, 0xe3, 0xf0,
|
||||
0x0e, 0xf0, 0x50, 0x0e, 0x33, 0x10, 0xc4, 0x1d, 0xde, 0x21, 0x1c, 0xd8,
|
||||
0x21, 0x1d, 0xc2, 0x61, 0x1e, 0x66, 0x30, 0x89, 0x3b, 0xbc, 0x83, 0x3b,
|
||||
0xd0, 0x43, 0x39, 0xb4, 0x03, 0x3c, 0xbc, 0x83, 0x3c, 0x84, 0x03, 0x3b,
|
||||
0xcc, 0xf0, 0x14, 0x76, 0x60, 0x07, 0x7b, 0x68, 0x07, 0x37, 0x68, 0x87,
|
||||
0x72, 0x68, 0x07, 0x37, 0x80, 0x87, 0x70, 0x90, 0x87, 0x70, 0x60, 0x07,
|
||||
0x76, 0x28, 0x07, 0x76, 0xf8, 0x05, 0x76, 0x78, 0x87, 0x77, 0x80, 0x87,
|
||||
0x5f, 0x08, 0x87, 0x71, 0x18, 0x87, 0x72, 0x98, 0x87, 0x79, 0x98, 0x81,
|
||||
0x2c, 0xee, 0xf0, 0x0e, 0xee, 0xe0, 0x0e, 0xf5, 0xc0, 0x0e, 0xec, 0x30,
|
||||
0x03, 0x62, 0xc8, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c, 0xcc, 0xa1, 0x1c, 0xe4,
|
||||
0xa1, 0x1c, 0xdc, 0x61, 0x1c, 0xca, 0x21, 0x1c, 0xc4, 0x81, 0x1d, 0xca,
|
||||
0x61, 0x06, 0xd6, 0x90, 0x43, 0x39, 0xc8, 0x43, 0x39, 0x98, 0x43, 0x39,
|
||||
0xc8, 0x43, 0x39, 0xb8, 0xc3, 0x38, 0x94, 0x43, 0x38, 0x88, 0x03, 0x3b,
|
||||
0x94, 0xc3, 0x2f, 0xbc, 0x83, 0x3c, 0xfc, 0x82, 0x3b, 0xd4, 0x03, 0x3b,
|
||||
0xb0, 0xc3, 0x8c, 0xc8, 0x21, 0x07, 0x7c, 0x70, 0x03, 0x72, 0x10, 0x87,
|
||||
0x73, 0x70, 0x03, 0x7b, 0x08, 0x07, 0x79, 0x60, 0x87, 0x70, 0xc8, 0x87,
|
||||
0x77, 0xa8, 0x07, 0x7a, 0x98, 0x81, 0x3c, 0xe4, 0x80, 0x0f, 0x6e, 0x40,
|
||||
0x0f, 0xe5, 0xd0, 0x0e, 0xf0, 0x00, 0x00, 0x00, 0x71, 0x20, 0x00, 0x00,
|
||||
0x22, 0x00, 0x00, 0x00, 0x46, 0x00, 0x0d, 0x97, 0xef, 0x3c, 0x7e, 0x80,
|
||||
0x34, 0x40, 0x84, 0xf9, 0xc5, 0x6d, 0xdb, 0xc1, 0x36, 0x5c, 0xbe, 0xf3,
|
||||
0xf8, 0x42, 0x40, 0x15, 0x05, 0x11, 0x95, 0x0e, 0x30, 0x94, 0x84, 0x01,
|
||||
0x08, 0x98, 0x5f, 0xdc, 0xb6, 0x21, 0x48, 0xc3, 0xe5, 0x3b, 0x8f, 0x2f,
|
||||
0x44, 0x04, 0x30, 0x11, 0x21, 0xd0, 0x0c, 0x0b, 0x61, 0x05, 0xce, 0x70,
|
||||
0xf9, 0xce, 0xe3, 0x0f, 0xce, 0x64, 0xfb, 0xc5, 0x6d, 0x5b, 0xc0, 0x34,
|
||||
0x5c, 0xbe, 0xf3, 0xf8, 0x8b, 0x03, 0x0c, 0x62, 0xf3, 0x50, 0x93, 0x5f,
|
||||
0xdc, 0xb6, 0x0d, 0x40, 0xc3, 0xe5, 0x3b, 0x8f, 0x2f, 0x01, 0xcc, 0xb3,
|
||||
0x10, 0x7e, 0x71, 0xdb, 0x26, 0x50, 0x0d, 0x97, 0xef, 0x3c, 0xbe, 0x34,
|
||||
0x39, 0x11, 0x81, 0x52, 0xd3, 0x43, 0x4d, 0x7e, 0x71, 0xdb, 0x66, 0xf0,
|
||||
0x0c, 0x97, 0xef, 0x3c, 0x3e, 0xd5, 0x00, 0x11, 0xe6, 0x17, 0xb7, 0x6d,
|
||||
0x00, 0x04, 0x03, 0x20, 0x0d, 0x00, 0x00, 0x00, 0x61, 0x20, 0x00, 0x00,
|
||||
0x86, 0x00, 0x00, 0x00, 0x13, 0x04, 0x41, 0x2c, 0x10, 0x00, 0x00, 0x00,
|
||||
0x0e, 0x00, 0x00, 0x00, 0x84, 0x8d, 0x00, 0x50, 0x51, 0x02, 0x65, 0x40,
|
||||
0x44, 0xb1, 0x95, 0xdd, 0x0c, 0x40, 0x21, 0x94, 0x51, 0x29, 0x94, 0x5c,
|
||||
0x21, 0x95, 0x69, 0x40, 0xa1, 0x06, 0x14, 0x1e, 0x0d, 0x23, 0x00, 0x63,
|
||||
0x04, 0x20, 0x08, 0x82, 0xf0, 0x2f, 0x8c, 0x11, 0x80, 0x20, 0x08, 0xc2,
|
||||
0xdf, 0x0c, 0xc0, 0x18, 0x01, 0x08, 0x82, 0x20, 0xfe, 0x01, 0x00, 0x00,
|
||||
0x23, 0x06, 0x09, 0x00, 0x82, 0x60, 0x90, 0x99, 0x81, 0xb2, 0x91, 0x01,
|
||||
0x19, 0x4c, 0x23, 0x06, 0x09, 0x00, 0x82, 0x60, 0x90, 0x9d, 0xc1, 0x22,
|
||||
0x95, 0x41, 0x19, 0x50, 0x23, 0x06, 0x09, 0x00, 0x82, 0x60, 0x90, 0xa1,
|
||||
0x01, 0xc3, 0x99, 0x81, 0x19, 0x54, 0x23, 0x06, 0x09, 0x00, 0x82, 0x60,
|
||||
0x60, 0xc0, 0x01, 0x84, 0x06, 0x67, 0xe0, 0x45, 0x23, 0x06, 0x09, 0x00,
|
||||
0x82, 0x60, 0x60, 0xc4, 0x41, 0x94, 0x06, 0x68, 0x60, 0x49, 0x23, 0x06,
|
||||
0x09, 0x00, 0x82, 0x60, 0x60, 0xc8, 0x81, 0x94, 0x06, 0x69, 0x00, 0x06,
|
||||
0xd3, 0x88, 0x41, 0x02, 0x80, 0x20, 0x18, 0x18, 0x73, 0x30, 0xa9, 0x81,
|
||||
0x1a, 0x60, 0xd4, 0x88, 0x41, 0x02, 0x80, 0x20, 0x18, 0x18, 0x74, 0x40,
|
||||
0xad, 0xc1, 0x1a, 0x84, 0x41, 0x35, 0x62, 0x90, 0x00, 0x20, 0x08, 0x06,
|
||||
0x46, 0x1d, 0x54, 0x6c, 0xc0, 0x06, 0x99, 0x35, 0x62, 0xf0, 0x00, 0x20,
|
||||
0x08, 0x06, 0x0d, 0x1d, 0x3c, 0x09, 0x62, 0x14, 0xcb, 0xd2, 0x06, 0x6d,
|
||||
0x70, 0x2d, 0xa3, 0x09, 0x01, 0x30, 0x9a, 0x20, 0x04, 0xa3, 0x09, 0x83,
|
||||
0x30, 0x62, 0x60, 0x00, 0x20, 0x08, 0x06, 0x53, 0x1d, 0x54, 0xca, 0x88,
|
||||
0x81, 0x01, 0x80, 0x20, 0x18, 0x4c, 0x76, 0x60, 0x29, 0x23, 0x06, 0x06,
|
||||
0x00, 0x82, 0x60, 0x30, 0xdd, 0x41, 0x1c, 0x08, 0x23, 0x06, 0x06, 0x00,
|
||||
0x82, 0x60, 0x30, 0xe1, 0x81, 0x1c, 0x08, 0x23, 0x06, 0x06, 0x00, 0x82,
|
||||
0x60, 0x30, 0xe5, 0x01, 0xe6, 0x8c, 0x18, 0x18, 0x00, 0x08, 0x82, 0xc1,
|
||||
0xa4, 0x07, 0x99, 0x33, 0x62, 0x60, 0x00, 0x20, 0x08, 0x06, 0xd3, 0x1e,
|
||||
0xd4, 0x81, 0x30, 0x62, 0x60, 0x00, 0x20, 0x08, 0x06, 0x13, 0x1f, 0xd8,
|
||||
0x81, 0x60, 0x82, 0x01, 0x1f, 0x13, 0x0c, 0xf8, 0x18, 0x26, 0xd0, 0xc7,
|
||||
0x32, 0x81, 0x3e, 0x23, 0x06, 0x07, 0x00, 0x82, 0x60, 0x60, 0x81, 0x02,
|
||||
0x1a, 0x5c, 0x7d, 0x30, 0x9a, 0x10, 0x00, 0xa3, 0x09, 0x42, 0x30, 0x9a,
|
||||
0x30, 0x08, 0x36, 0x08, 0xf4, 0x31, 0x42, 0xa0, 0xcf, 0x88, 0x41, 0x02,
|
||||
0x80, 0x20, 0x18, 0x44, 0xa8, 0xf0, 0x06, 0x42, 0x80, 0x1c, 0x16, 0x8c,
|
||||
0x81, 0x7c, 0x46, 0x0c, 0x0e, 0x00, 0x04, 0xc1, 0xe0, 0x59, 0x85, 0x36,
|
||||
0x08, 0xc4, 0x60, 0xc4, 0xe0, 0x00, 0x40, 0x10, 0x0c, 0x1e, 0x56, 0x70,
|
||||
0x03, 0xec, 0x1a, 0x31, 0x38, 0x00, 0x10, 0x04, 0x83, 0xa7, 0x15, 0xd8,
|
||||
0x20, 0xb8, 0x46, 0x0c, 0x0e, 0x00, 0x04, 0xc1, 0xe0, 0x71, 0x85, 0x36,
|
||||
0xd0, 0xb2, 0x11, 0x83, 0x03, 0x00, 0x41, 0x30, 0x78, 0x5e, 0x21, 0x0e,
|
||||
0x02, 0xc1, 0x02, 0x35, 0x80, 0x8f, 0x05, 0x86, 0x7c, 0x2c, 0x58, 0x03,
|
||||
0xf8, 0x8c, 0x18, 0x1c, 0x00, 0x08, 0x82, 0xc1, 0x33, 0x0b, 0x75, 0x10,
|
||||
0xb8, 0xc1, 0x88, 0xc1, 0x01, 0x80, 0x20, 0x18, 0x3c, 0xb4, 0x30, 0x07,
|
||||
0xc1, 0x1a, 0x58, 0x30, 0x06, 0xf2, 0x19, 0x31, 0x48, 0x00, 0x10, 0x04,
|
||||
0x03, 0x04, 0x17, 0xee, 0x00, 0x16, 0x60, 0xe1, 0x14, 0xce, 0x60, 0xc4,
|
||||
0x20, 0x01, 0x40, 0x10, 0x0c, 0x10, 0x5c, 0xb8, 0x03, 0x58, 0x80, 0x05,
|
||||
0x3f, 0x30, 0x83, 0x11, 0x83, 0x04, 0x00, 0x41, 0x30, 0x40, 0x70, 0xe1,
|
||||
0x0e, 0x60, 0x01, 0x16, 0x4c, 0xa1, 0x0c, 0x46, 0x0c, 0x12, 0x00, 0x04,
|
||||
0xc1, 0x00, 0xc1, 0x85, 0x3b, 0x80, 0x05, 0x58, 0xe8, 0x83, 0x00, 0x01,
|
||||
0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
static const unsigned int testgpurender_msdf_frag_dxil_len = 4744;
|
||||
@@ -0,0 +1,37 @@
|
||||
cbuffer Context : register(b0, space3) {
|
||||
float distance_field_range;
|
||||
float2 texture_size;
|
||||
};
|
||||
|
||||
Texture2D u_texture : register(t0, space2);
|
||||
SamplerState u_sampler : register(s0, space2);
|
||||
|
||||
struct PSInput {
|
||||
float4 v_color : COLOR0;
|
||||
float2 v_uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct PSOutput {
|
||||
float4 o_color : SV_Target;
|
||||
};
|
||||
|
||||
float median(float r, float g, float b) {
|
||||
return max(min(r, g), min(max(r, g), b));
|
||||
}
|
||||
|
||||
float screenPxRange(float2 texCoord) {
|
||||
float2 unitRange = float2(distance_field_range, distance_field_range)/texture_size;
|
||||
float2 screenTexSize = float2(1.0, 1.0)/fwidth(texCoord);
|
||||
return max(0.5*dot(unitRange, screenTexSize), 1.0);
|
||||
}
|
||||
|
||||
PSOutput main(PSInput input) {
|
||||
PSOutput output;
|
||||
float3 msd = u_texture.Sample(u_sampler, input.v_uv).rgb;
|
||||
float sd = median(msd.r, msd.g, msd.b);
|
||||
float screenPxDistance = screenPxRange(input.v_uv)*(sd - 0.5);
|
||||
float opacity = clamp(screenPxDistance + 0.5, 0.0, 1.0);
|
||||
output.o_color.rgb = input.v_color.rgb;
|
||||
output.o_color.a = (input.v_color.a * opacity);
|
||||
return output;
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
static const unsigned char testgpurender_msdf_frag_msl[] = {
|
||||
0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65,
|
||||
0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x3e, 0x0a,
|
||||
0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x73, 0x69,
|
||||
0x6d, 0x64, 0x2f, 0x73, 0x69, 0x6d, 0x64, 0x2e, 0x68, 0x3e, 0x0a, 0x0a,
|
||||
0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70,
|
||||
0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x0a,
|
||||
0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x74, 0x79, 0x70, 0x65, 0x5f,
|
||||
0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x0a, 0x7b, 0x0a, 0x20, 0x20,
|
||||
0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x64, 0x69, 0x73, 0x74,
|
||||
0x61, 0x6e, 0x63, 0x65, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x72,
|
||||
0x61, 0x6e, 0x67, 0x65, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x70, 0x61,
|
||||
0x63, 0x6b, 0x65, 0x64, 0x5f, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20,
|
||||
0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65,
|
||||
0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61,
|
||||
0x6e, 0x74, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x33,
|
||||
0x35, 0x20, 0x3d, 0x20, 0x7b, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72,
|
||||
0x75, 0x63, 0x74, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x30, 0x5f, 0x6f, 0x75,
|
||||
0x74, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61,
|
||||
0x74, 0x34, 0x20, 0x6f, 0x75, 0x74, 0x5f, 0x76, 0x61, 0x72, 0x5f, 0x53,
|
||||
0x56, 0x5f, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x20, 0x5b, 0x5b, 0x63,
|
||||
0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d,
|
||||
0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x6d, 0x61,
|
||||
0x69, 0x6e, 0x30, 0x5f, 0x69, 0x6e, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20,
|
||||
0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x69, 0x6e, 0x5f, 0x76,
|
||||
0x61, 0x72, 0x5f, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x30, 0x20, 0x5b, 0x5b,
|
||||
0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, 0x30, 0x29, 0x5d,
|
||||
0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74,
|
||||
0x32, 0x20, 0x69, 0x6e, 0x5f, 0x76, 0x61, 0x72, 0x5f, 0x54, 0x45, 0x58,
|
||||
0x43, 0x4f, 0x4f, 0x52, 0x44, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65,
|
||||
0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a,
|
||||
0x7d, 0x3b, 0x0a, 0x0a, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74,
|
||||
0x20, 0x6d, 0x61, 0x69, 0x6e, 0x30, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x6d,
|
||||
0x61, 0x69, 0x6e, 0x30, 0x28, 0x6d, 0x61, 0x69, 0x6e, 0x30, 0x5f, 0x69,
|
||||
0x6e, 0x20, 0x69, 0x6e, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65,
|
||||
0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74,
|
||||
0x61, 0x6e, 0x74, 0x20, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x43, 0x6f, 0x6e,
|
||||
0x74, 0x65, 0x78, 0x74, 0x26, 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78,
|
||||
0x74, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, 0x30,
|
||||
0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65,
|
||||
0x32, 0x64, 0x3c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3e, 0x20, 0x75, 0x5f,
|
||||
0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x20, 0x5b, 0x5b, 0x74, 0x65,
|
||||
0x78, 0x74, 0x75, 0x72, 0x65, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x2c, 0x20,
|
||||
0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x20, 0x75, 0x5f, 0x73, 0x61,
|
||||
0x6d, 0x70, 0x6c, 0x65, 0x72, 0x20, 0x5b, 0x5b, 0x73, 0x61, 0x6d, 0x70,
|
||||
0x6c, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a,
|
||||
0x20, 0x20, 0x20, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x30, 0x5f, 0x6f, 0x75,
|
||||
0x74, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x3d, 0x20, 0x7b, 0x7d, 0x3b, 0x0a,
|
||||
0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f,
|
||||
0x34, 0x32, 0x20, 0x3d, 0x20, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x75,
|
||||
0x72, 0x65, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x75, 0x5f,
|
||||
0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x69, 0x6e, 0x2e,
|
||||
0x69, 0x6e, 0x5f, 0x76, 0x61, 0x72, 0x5f, 0x54, 0x45, 0x58, 0x43, 0x4f,
|
||||
0x4f, 0x52, 0x44, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66,
|
||||
0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x34, 0x33, 0x20, 0x3d, 0x20, 0x5f,
|
||||
0x34, 0x32, 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c,
|
||||
0x6f, 0x61, 0x74, 0x20, 0x5f, 0x34, 0x34, 0x20, 0x3d, 0x20, 0x5f, 0x34,
|
||||
0x32, 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f,
|
||||
0x61, 0x74, 0x34, 0x20, 0x5f, 0x36, 0x35, 0x20, 0x3d, 0x20, 0x66, 0x6c,
|
||||
0x6f, 0x61, 0x74, 0x34, 0x28, 0x69, 0x6e, 0x2e, 0x69, 0x6e, 0x5f, 0x76,
|
||||
0x61, 0x72, 0x5f, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x30, 0x2e, 0x78, 0x2c,
|
||||
0x20, 0x69, 0x6e, 0x2e, 0x69, 0x6e, 0x5f, 0x76, 0x61, 0x72, 0x5f, 0x43,
|
||||
0x4f, 0x4c, 0x4f, 0x52, 0x30, 0x2e, 0x79, 0x2c, 0x20, 0x69, 0x6e, 0x2e,
|
||||
0x69, 0x6e, 0x5f, 0x76, 0x61, 0x72, 0x5f, 0x43, 0x4f, 0x4c, 0x4f, 0x52,
|
||||
0x30, 0x2e, 0x7a, 0x2c, 0x20, 0x5f, 0x33, 0x35, 0x2e, 0x77, 0x29, 0x3b,
|
||||
0x0a, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x35, 0x2e, 0x77, 0x20, 0x3d,
|
||||
0x20, 0x69, 0x6e, 0x2e, 0x69, 0x6e, 0x5f, 0x76, 0x61, 0x72, 0x5f, 0x43,
|
||||
0x4f, 0x4c, 0x4f, 0x52, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x66, 0x61,
|
||||
0x73, 0x74, 0x3a, 0x3a, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x28, 0x28, 0x70,
|
||||
0x72, 0x65, 0x63, 0x69, 0x73, 0x65, 0x3a, 0x3a, 0x6d, 0x61, 0x78, 0x28,
|
||||
0x30, 0x2e, 0x35, 0x20, 0x2a, 0x20, 0x64, 0x6f, 0x74, 0x28, 0x66, 0x6c,
|
||||
0x6f, 0x61, 0x74, 0x32, 0x28, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74,
|
||||
0x2e, 0x64, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x66, 0x69,
|
||||
0x65, 0x6c, 0x64, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x29, 0x20, 0x2f,
|
||||
0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x28, 0x43, 0x6f, 0x6e, 0x74,
|
||||
0x65, 0x78, 0x74, 0x2e, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x5f,
|
||||
0x73, 0x69, 0x7a, 0x65, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74,
|
||||
0x32, 0x28, 0x31, 0x2e, 0x30, 0x29, 0x20, 0x2f, 0x20, 0x66, 0x77, 0x69,
|
||||
0x64, 0x74, 0x68, 0x28, 0x69, 0x6e, 0x2e, 0x69, 0x6e, 0x5f, 0x76, 0x61,
|
||||
0x72, 0x5f, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x30, 0x29,
|
||||
0x29, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x20, 0x2a, 0x20, 0x28, 0x70,
|
||||
0x72, 0x65, 0x63, 0x69, 0x73, 0x65, 0x3a, 0x3a, 0x6d, 0x61, 0x78, 0x28,
|
||||
0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x65, 0x3a, 0x3a, 0x6d, 0x69, 0x6e,
|
||||
0x28, 0x5f, 0x34, 0x33, 0x2c, 0x20, 0x5f, 0x34, 0x34, 0x29, 0x2c, 0x20,
|
||||
0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x65, 0x3a, 0x3a, 0x6d, 0x69, 0x6e,
|
||||
0x28, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x65, 0x3a, 0x3a, 0x6d, 0x61,
|
||||
0x78, 0x28, 0x5f, 0x34, 0x33, 0x2c, 0x20, 0x5f, 0x34, 0x34, 0x29, 0x2c,
|
||||
0x20, 0x5f, 0x34, 0x32, 0x2e, 0x7a, 0x29, 0x29, 0x20, 0x2d, 0x20, 0x30,
|
||||
0x2e, 0x35, 0x29, 0x29, 0x20, 0x2b, 0x20, 0x30, 0x2e, 0x35, 0x2c, 0x20,
|
||||
0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20,
|
||||
0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x6f, 0x75, 0x74, 0x5f, 0x76,
|
||||
0x61, 0x72, 0x5f, 0x53, 0x56, 0x5f, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74,
|
||||
0x20, 0x3d, 0x20, 0x5f, 0x36, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20,
|
||||
0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, 0x0a,
|
||||
0x7d, 0x0a, 0x0a
|
||||
};
|
||||
static const unsigned int testgpurender_msdf_frag_msl_len = 1119;
|
||||
@@ -0,0 +1,162 @@
|
||||
static const unsigned char testgpurender_msdf_frag_spv[] = {
|
||||
0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0e, 0x00,
|
||||
0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30,
|
||||
0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
|
||||
0x10, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0x58, 0x02, 0x00, 0x00,
|
||||
0x05, 0x00, 0x06, 0x00, 0x06, 0x00, 0x00, 0x00, 0x74, 0x79, 0x70, 0x65,
|
||||
0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x00, 0x00, 0x00, 0x00,
|
||||
0x06, 0x00, 0x09, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x64, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x66, 0x69, 0x65,
|
||||
0x6c, 0x64, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x00, 0x00, 0x00, 0x00,
|
||||
0x06, 0x00, 0x07, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65,
|
||||
0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00,
|
||||
0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x00, 0x05, 0x00, 0x06, 0x00,
|
||||
0x08, 0x00, 0x00, 0x00, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x32, 0x64, 0x2e,
|
||||
0x69, 0x6d, 0x61, 0x67, 0x65, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00,
|
||||
0x09, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72,
|
||||
0x65, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x0a, 0x00, 0x00, 0x00,
|
||||
0x74, 0x79, 0x70, 0x65, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72,
|
||||
0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00,
|
||||
0x75, 0x5f, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00,
|
||||
0x05, 0x00, 0x06, 0x00, 0x03, 0x00, 0x00, 0x00, 0x69, 0x6e, 0x2e, 0x76,
|
||||
0x61, 0x72, 0x2e, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x30, 0x00, 0x00, 0x00,
|
||||
0x05, 0x00, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x69, 0x6e, 0x2e, 0x76,
|
||||
0x61, 0x72, 0x2e, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x30,
|
||||
0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x05, 0x00, 0x00, 0x00,
|
||||
0x6f, 0x75, 0x74, 0x2e, 0x76, 0x61, 0x72, 0x2e, 0x53, 0x56, 0x5f, 0x54,
|
||||
0x61, 0x72, 0x67, 0x65, 0x74, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00,
|
||||
0x05, 0x00, 0x07, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x74, 0x79, 0x70, 0x65,
|
||||
0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x64, 0x2e, 0x69, 0x6d, 0x61,
|
||||
0x67, 0x65, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x03, 0x00, 0x00, 0x00,
|
||||
0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
|
||||
0x04, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x47, 0x00, 0x04, 0x00, 0x05, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00,
|
||||
0x22, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
|
||||
0x07, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x47, 0x00, 0x04, 0x00, 0x09, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x09, 0x00, 0x00, 0x00,
|
||||
0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
|
||||
0x0b, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x47, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x48, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x23, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00,
|
||||
0x06, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00,
|
||||
0x0d, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x2b, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00,
|
||||
0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00,
|
||||
0x10, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00,
|
||||
0x10, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f,
|
||||
0x2b, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||
0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x2b, 0x00, 0x04, 0x00,
|
||||
0x0d, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
|
||||
0x17, 0x00, 0x04, 0x00, 0x15, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x05, 0x00, 0x15, 0x00, 0x00, 0x00,
|
||||
0x16, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00,
|
||||
0x1e, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||
0x15, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x17, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00,
|
||||
0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
|
||||
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
|
||||
0x1a, 0x00, 0x02, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
|
||||
0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00,
|
||||
0x17, 0x00, 0x04, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||
0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x1b, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
|
||||
0x1c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00,
|
||||
0x20, 0x00, 0x04, 0x00, 0x1d, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
|
||||
0x1a, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x1e, 0x00, 0x00, 0x00,
|
||||
0x21, 0x00, 0x03, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00,
|
||||
0x1b, 0x00, 0x03, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
|
||||
0x20, 0x00, 0x04, 0x00, 0x20, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x10, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x21, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00,
|
||||
0x17, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x3b, 0x00, 0x04, 0x00, 0x18, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x19, 0x00, 0x00, 0x00,
|
||||
0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00,
|
||||
0x1b, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x3b, 0x00, 0x04, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x1d, 0x00, 0x00, 0x00,
|
||||
0x05, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
|
||||
0x22, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x03, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00,
|
||||
0x36, 0x00, 0x05, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00,
|
||||
0x24, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x1a, 0x00, 0x00, 0x00,
|
||||
0x25, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00,
|
||||
0x15, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
|
||||
0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00,
|
||||
0x09, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0a, 0x00, 0x00, 0x00,
|
||||
0x28, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00,
|
||||
0x0c, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00,
|
||||
0x28, 0x00, 0x00, 0x00, 0x57, 0x00, 0x06, 0x00, 0x1a, 0x00, 0x00, 0x00,
|
||||
0x2a, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||
0x2b, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x51, 0x00, 0x05, 0x00, 0x10, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00,
|
||||
0x2a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00,
|
||||
0x10, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||
0x2e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00,
|
||||
0x2b, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00,
|
||||
0x10, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x50, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00,
|
||||
0x0c, 0x00, 0x07, 0x00, 0x10, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00,
|
||||
0x2d, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||
0x31, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00,
|
||||
0x2e, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00,
|
||||
0x20, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
|
||||
0x0f, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||
0x33, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00,
|
||||
0x15, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00,
|
||||
0x33, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x21, 0x00, 0x00, 0x00,
|
||||
0x35, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00,
|
||||
0x3d, 0x00, 0x04, 0x00, 0x15, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00,
|
||||
0x35, 0x00, 0x00, 0x00, 0x88, 0x00, 0x05, 0x00, 0x15, 0x00, 0x00, 0x00,
|
||||
0x37, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00,
|
||||
0xd1, 0x00, 0x04, 0x00, 0x15, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00,
|
||||
0x26, 0x00, 0x00, 0x00, 0x88, 0x00, 0x05, 0x00, 0x15, 0x00, 0x00, 0x00,
|
||||
0x39, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00,
|
||||
0x94, 0x00, 0x05, 0x00, 0x10, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00,
|
||||
0x37, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00,
|
||||
0x10, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00,
|
||||
0x3a, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||
0x3c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00,
|
||||
0x3b, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00,
|
||||
0x10, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00,
|
||||
0x11, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||
0x3e, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00,
|
||||
0x81, 0x00, 0x05, 0x00, 0x10, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00,
|
||||
0x3e, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00,
|
||||
0x10, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x2b, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00,
|
||||
0x13, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x09, 0x00, 0x1a, 0x00, 0x00, 0x00,
|
||||
0x41, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00,
|
||||
0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x22, 0x00, 0x00, 0x00,
|
||||
0x42, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00,
|
||||
0x3d, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00,
|
||||
0x42, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||
0x44, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
|
||||
0x52, 0x00, 0x06, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00,
|
||||
0x44, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
|
||||
0x3e, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00,
|
||||
0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00
|
||||
};
|
||||
static const unsigned int testgpurender_msdf_frag_spv_len = 1904;
|
||||
@@ -37,7 +37,7 @@ int main(int argc, char **argv)
|
||||
char *name = NULL;
|
||||
int index = -1;
|
||||
SDL_HapticEffect efx[9];
|
||||
int id[9];
|
||||
SDL_HapticEffectID id[9];
|
||||
int nefx;
|
||||
unsigned int supported;
|
||||
SDL_HapticID *haptics;
|
||||
|
||||
@@ -987,18 +987,19 @@ int main(int argc, char *argv[])
|
||||
WindowState *ctx = &windowstate[i];
|
||||
SDL_Window *window = state->windows[i];
|
||||
SDL_Renderer *renderer = state->renderers[i];
|
||||
int icon_w = 0, icon_h = 0;
|
||||
|
||||
SDL_SetRenderLogicalPresentation(renderer, WINDOW_WIDTH, WINDOW_HEIGHT, SDL_LOGICAL_PRESENTATION_LETTERBOX);
|
||||
|
||||
ctx->window = window;
|
||||
ctx->renderer = renderer;
|
||||
ctx->rendererID = i;
|
||||
ctx->settings_icon = LoadTexture(renderer, "icon.bmp", true, &icon_w, &icon_h);
|
||||
ctx->settings_rect.x = (float)WINDOW_WIDTH - icon_w - MARGIN;
|
||||
ctx->settings_rect.y = MARGIN;
|
||||
ctx->settings_rect.w = (float)icon_w;
|
||||
ctx->settings_rect.h = (float)icon_h;
|
||||
ctx->settings_icon = LoadTexture(renderer, "icon.bmp", true);
|
||||
if (ctx->settings_icon) {
|
||||
ctx->settings_rect.w = (float)ctx->settings_icon->w;
|
||||
ctx->settings_rect.h = (float)ctx->settings_icon->h;
|
||||
ctx->settings_rect.x = (float)WINDOW_WIDTH - ctx->settings_rect.w - MARGIN;
|
||||
ctx->settings_rect.y = MARGIN;
|
||||
}
|
||||
|
||||
InitInput(ctx);
|
||||
|
||||
|
||||
@@ -23,8 +23,7 @@
|
||||
#endif
|
||||
|
||||
/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
|
||||
static void
|
||||
quit(int rc)
|
||||
static void quit(int rc)
|
||||
{
|
||||
SDL_Quit();
|
||||
/* Let 'main()' return normally */
|
||||
@@ -33,9 +32,9 @@ quit(int rc)
|
||||
}
|
||||
}
|
||||
|
||||
static int SDLCALL
|
||||
button_messagebox(void *eventNumber)
|
||||
static int SDLCALL button_messagebox(void *eventNumber)
|
||||
{
|
||||
int i;
|
||||
const SDL_MessageBoxButtonData buttons[] = {
|
||||
{ SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT,
|
||||
0,
|
||||
@@ -43,52 +42,79 @@ button_messagebox(void *eventNumber)
|
||||
{ SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT,
|
||||
1,
|
||||
"Cancel" },
|
||||
{ 0,
|
||||
2,
|
||||
"Retry" }
|
||||
};
|
||||
|
||||
SDL_MessageBoxData data = {
|
||||
SDL_MESSAGEBOX_INFORMATION,
|
||||
NULL, /* no parent window */
|
||||
"Custom MessageBox",
|
||||
"This is a custom messagebox",
|
||||
2,
|
||||
SDL_arraysize(buttons),
|
||||
NULL, /* buttons */
|
||||
NULL /* Default color scheme */
|
||||
};
|
||||
|
||||
int button = -1;
|
||||
int success = 0;
|
||||
data.buttons = buttons;
|
||||
if (eventNumber) {
|
||||
data.message = "This is a custom messagebox from a background thread.";
|
||||
}
|
||||
for (i = 0; ; ++i) {
|
||||
SDL_MessageBoxColorScheme colorScheme;
|
||||
if (i != 0) {
|
||||
int j;
|
||||
for (j = 0; j < SDL_MESSAGEBOX_COLOR_COUNT; ++j) {
|
||||
colorScheme.colors[j].r = SDL_rand(256);
|
||||
colorScheme.colors[j].g = SDL_rand(256);
|
||||
colorScheme.colors[j].b = SDL_rand(256);
|
||||
}
|
||||
data.colorScheme = &colorScheme;
|
||||
} else {
|
||||
data.colorScheme = NULL;
|
||||
}
|
||||
|
||||
int button = -1;
|
||||
data.buttons = buttons;
|
||||
if (eventNumber) {
|
||||
data.message = "This is a custom messagebox from a background thread.";
|
||||
}
|
||||
|
||||
if (!SDL_ShowMessageBox(&data, &button)) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s", SDL_GetError());
|
||||
if (eventNumber) {
|
||||
SDL_Event event;
|
||||
event.type = (Uint32)(intptr_t)eventNumber;
|
||||
SDL_PushEvent(&event);
|
||||
return 1;
|
||||
} else {
|
||||
quit(2);
|
||||
}
|
||||
}
|
||||
|
||||
const char* text;
|
||||
if (button == 1) {
|
||||
text = "Cancel";
|
||||
} else if (button == 2) {
|
||||
text = "Retry";
|
||||
} else {
|
||||
text = "OK";
|
||||
}
|
||||
SDL_Log("Pressed button: %d, %s", button, button == -1 ? "[closed]" : text);
|
||||
|
||||
if (button == 2) {
|
||||
continue;
|
||||
}
|
||||
|
||||
success = SDL_ShowMessageBox(&data, &button);
|
||||
if (success == -1) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s", SDL_GetError());
|
||||
if (eventNumber) {
|
||||
SDL_Event event;
|
||||
event.type = (Uint32)(intptr_t)eventNumber;
|
||||
SDL_PushEvent(&event);
|
||||
return 1;
|
||||
} else {
|
||||
quit(2);
|
||||
}
|
||||
}
|
||||
SDL_Log("Pressed button: %d, %s", button, button == -1 ? "[closed]" : button == 1 ? "Cancel"
|
||||
: "OK");
|
||||
|
||||
if (eventNumber) {
|
||||
SDL_Event event;
|
||||
event.type = (Uint32)(intptr_t)eventNumber;
|
||||
SDL_PushEvent(&event);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int success;
|
||||
bool success;
|
||||
SDLTest_CommonState *state;
|
||||
|
||||
/* Initialize test framework */
|
||||
|
||||
@@ -97,7 +97,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
if (e.key.key == SDLK_M) {
|
||||
if (SDL_SetWindowParent(w2, w2)) {
|
||||
if (SDL_SetWindowParent(w2, w1)) {
|
||||
if (SDL_SetWindowModal(w2, true)) {
|
||||
SDL_SetWindowTitle(w2, "Modal Window");
|
||||
}
|
||||
|
||||
@@ -117,6 +117,8 @@ static void loop(void *arg)
|
||||
struct mouse_loop_data *loop_data = (struct mouse_loop_data *)arg;
|
||||
SDL_Event event;
|
||||
SDL_Renderer *renderer = loop_data->renderer;
|
||||
float fx, fy;
|
||||
SDL_MouseButtonFlags flags;
|
||||
|
||||
/* Check for events */
|
||||
while (SDL_PollEvent(&event)) {
|
||||
@@ -265,6 +267,10 @@ static void loop(void *arg)
|
||||
DrawObject(renderer, active);
|
||||
}
|
||||
|
||||
flags = SDL_GetGlobalMouseState(&fx, &fy);
|
||||
SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255);
|
||||
SDL_RenderDebugTextFormat(renderer, 0, 0, "Global Mouse State: x=%f y=%f flags=%" SDL_PRIu32, fx, fy, flags);
|
||||
|
||||
SDL_RenderPresent(renderer);
|
||||
|
||||
#ifdef SDL_PLATFORM_EMSCRIPTEN
|
||||
|
||||
@@ -168,7 +168,7 @@ int main(int argc, char *argv[])
|
||||
SDL_SetRenderDrawColor(renderer, 0xA0, 0xA0, 0xA0, 0xFF);
|
||||
SDL_RenderClear(renderer);
|
||||
|
||||
sprite = LoadTexture(renderer, "icon.bmp", true, NULL, NULL);
|
||||
sprite = LoadTexture(renderer, "icon.bmp", true);
|
||||
if (!sprite) {
|
||||
quit(6);
|
||||
}
|
||||
|
||||
@@ -49,6 +49,9 @@ struct PopupWindow
|
||||
static struct PopupWindow *menus;
|
||||
static struct PopupWindow tooltip;
|
||||
|
||||
static bool no_constraints;
|
||||
static bool no_grab;
|
||||
|
||||
/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
|
||||
static void quit(int rc)
|
||||
{
|
||||
@@ -95,14 +98,27 @@ static bool create_popup(struct PopupWindow *new_popup, bool is_menu)
|
||||
const int w = is_menu ? MENU_WIDTH : TOOLTIP_WIDTH;
|
||||
const int h = is_menu ? MENU_HEIGHT : TOOLTIP_HEIGHT;
|
||||
const int v_off = is_menu ? 0 : 32;
|
||||
const SDL_WindowFlags flags = is_menu ? SDL_WINDOW_POPUP_MENU : SDL_WINDOW_TOOLTIP;
|
||||
float x, y;
|
||||
|
||||
focus = SDL_GetMouseFocus();
|
||||
|
||||
SDL_GetMouseState(&x, &y);
|
||||
new_win = SDL_CreatePopupWindow(focus,
|
||||
(int)x, (int)y + v_off, w, h, flags);
|
||||
|
||||
SDL_PropertiesID props = SDL_CreateProperties();
|
||||
SDL_SetPointerProperty(props, SDL_PROP_WINDOW_CREATE_PARENT_POINTER, focus);
|
||||
SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_CONSTRAIN_POPUP_BOOLEAN, !no_constraints);
|
||||
SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_FOCUSABLE_BOOLEAN, !no_grab);
|
||||
if (is_menu) {
|
||||
SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_MENU_BOOLEAN, true);
|
||||
} else {
|
||||
SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_TOOLTIP_BOOLEAN, true);
|
||||
}
|
||||
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER, w);
|
||||
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER, h);
|
||||
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_X_NUMBER, (int)x);
|
||||
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_Y_NUMBER, (int)y + v_off);
|
||||
new_win = SDL_CreateWindowWithProperties(props);
|
||||
SDL_DestroyProperties(props);
|
||||
|
||||
if (new_win) {
|
||||
new_renderer = SDL_CreateRenderer(new_win, state->renderdriver);
|
||||
@@ -249,8 +265,30 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
/* Parse commandline */
|
||||
if (!SDLTest_CommonDefaultArgs(state, argc, argv)) {
|
||||
return 1;
|
||||
for (i = 1; i < argc;) {
|
||||
int consumed;
|
||||
|
||||
consumed = SDLTest_CommonArg(state, i);
|
||||
if (consumed == 0) {
|
||||
consumed = -1;
|
||||
if (SDL_strcasecmp(argv[i], "--no-constraints") == 0) {
|
||||
no_constraints = true;
|
||||
consumed = 1;
|
||||
} else if (SDL_strcasecmp(argv[i], "--no-grab") == 0) {
|
||||
no_grab = true;
|
||||
consumed = 1;
|
||||
}
|
||||
}
|
||||
if (consumed < 0) {
|
||||
static const char *options[] = {
|
||||
"[--no-constraints]",
|
||||
"[--no-grab]",
|
||||
NULL
|
||||
};
|
||||
SDLTest_CommonLogUsage(state, argv[0], options);
|
||||
return 1;
|
||||
}
|
||||
i += consumed;
|
||||
}
|
||||
|
||||
if (!SDLTest_CommonInit(state)) {
|
||||
|
||||
@@ -82,7 +82,7 @@ static int SDLCALL process_testArguments(void *arg)
|
||||
"",
|
||||
" ",
|
||||
"a b c",
|
||||
"a\tb\tc\t",
|
||||
"a\tb\tc\t\v\r\n",
|
||||
"\"a b\" c",
|
||||
"'a' 'b' 'c'",
|
||||
"%d%%%s",
|
||||
@@ -965,6 +965,165 @@ cleanup:
|
||||
return TEST_COMPLETED;
|
||||
}
|
||||
|
||||
static int process_testWindowsCmdline(void *arg)
|
||||
{
|
||||
TestProcessData *data = (TestProcessData *)arg;
|
||||
const char *process_args[] = {
|
||||
data->childprocess_path,
|
||||
"--print-arguments",
|
||||
"--",
|
||||
"",
|
||||
" ",
|
||||
"a b c",
|
||||
"a\tb\tc\t",
|
||||
"\"a b\" c",
|
||||
"'a' 'b' 'c'",
|
||||
"%d%%%s",
|
||||
"\\t\\c",
|
||||
"evil\\",
|
||||
"a\\b\"c\\",
|
||||
"\"\\^&|<>%", /* characters with a special meaning */
|
||||
NULL
|
||||
};
|
||||
/* this will have the same result as process_args, but escaped in a different way */
|
||||
const char *process_cmdline_template =
|
||||
"%s "
|
||||
"--print-arguments "
|
||||
"-- "
|
||||
"\"\" "
|
||||
"\" \" "
|
||||
"a\" \"b\" \"c\t" /* using tab as delimiter */
|
||||
"\"a\tb\tc\t\" "
|
||||
"\"\"\"\"a b\"\"\" c\" "
|
||||
"\"'a' 'b' 'c'\" "
|
||||
"%%d%%%%%%s " /* will be passed to sprintf */
|
||||
"\\t\\c "
|
||||
"evil\\ "
|
||||
"a\\b\"\\\"\"c\\ "
|
||||
"\\\"\\^&|<>%%";
|
||||
char process_cmdline[65535];
|
||||
SDL_PropertiesID props;
|
||||
SDL_Process *process = NULL;
|
||||
char *buffer;
|
||||
int exit_code;
|
||||
int i;
|
||||
size_t total_read = 0;
|
||||
|
||||
#ifndef SDL_PLATFORM_WINDOWS
|
||||
SDLTest_AssertPass("SDL_PROP_PROCESS_CREATE_CMDLINE_STRING only works on Windows");
|
||||
return TEST_SKIPPED;
|
||||
#endif
|
||||
|
||||
props = SDL_CreateProperties();
|
||||
SDLTest_AssertCheck(props != 0, "SDL_CreateProperties()");
|
||||
if (!props) {
|
||||
goto failed;
|
||||
}
|
||||
SDL_SetNumberProperty(props, SDL_PROP_PROCESS_CREATE_STDIN_NUMBER, SDL_PROCESS_STDIO_APP);
|
||||
SDL_SetNumberProperty(props, SDL_PROP_PROCESS_CREATE_STDOUT_NUMBER, SDL_PROCESS_STDIO_APP);
|
||||
SDL_SetBooleanProperty(props, SDL_PROP_PROCESS_CREATE_STDERR_TO_STDOUT_BOOLEAN, true);
|
||||
|
||||
process = SDL_CreateProcessWithProperties(props);
|
||||
SDLTest_AssertCheck(process == NULL, "SDL_CreateProcessWithProperties() should fail");
|
||||
|
||||
SDL_snprintf(process_cmdline, SDL_arraysize(process_cmdline), process_cmdline_template, data->childprocess_path);
|
||||
SDL_SetStringProperty(props, SDL_PROP_PROCESS_CREATE_CMDLINE_STRING, process_cmdline);
|
||||
|
||||
process = SDL_CreateProcessWithProperties(props);
|
||||
SDLTest_AssertCheck(process != NULL, "SDL_CreateProcessWithProperties()");
|
||||
if (!process) {
|
||||
goto failed;
|
||||
}
|
||||
|
||||
exit_code = 0xdeadbeef;
|
||||
buffer = (char *)SDL_ReadProcess(process, &total_read, &exit_code);
|
||||
SDLTest_AssertCheck(buffer != NULL, "SDL_ReadProcess()");
|
||||
SDLTest_AssertCheck(exit_code == 0, "Exit code should be 0, is %d", exit_code);
|
||||
if (!buffer) {
|
||||
goto failed;
|
||||
}
|
||||
SDLTest_LogEscapedString("stdout of process: ", buffer, total_read);
|
||||
|
||||
for (i = 3; process_args[i]; i++) {
|
||||
char line[64];
|
||||
SDL_snprintf(line, sizeof(line), "|%d=%s|", i - 3, process_args[i]);
|
||||
SDLTest_AssertCheck(!!SDL_strstr(buffer, line), "Check %s is in output", line);
|
||||
}
|
||||
SDL_free(buffer);
|
||||
|
||||
SDLTest_AssertPass("About to destroy process");
|
||||
SDL_DestroyProcess(process);
|
||||
|
||||
return TEST_COMPLETED;
|
||||
|
||||
failed:
|
||||
SDL_DestroyProcess(process);
|
||||
return TEST_ABORTED;
|
||||
}
|
||||
|
||||
static int process_testWindowsCmdlinePrecedence(void *arg)
|
||||
{
|
||||
TestProcessData *data = (TestProcessData *)arg;
|
||||
const char *process_args[] = {
|
||||
data->childprocess_path,
|
||||
"--print-arguments",
|
||||
"--",
|
||||
"argument 1",
|
||||
NULL
|
||||
};
|
||||
const char *process_cmdline_template = "%s --print-arguments -- \"argument 2\"";
|
||||
char process_cmdline[65535];
|
||||
SDL_PropertiesID props;
|
||||
SDL_Process *process = NULL;
|
||||
char *buffer;
|
||||
int exit_code;
|
||||
size_t total_read = 0;
|
||||
|
||||
#ifndef SDL_PLATFORM_WINDOWS
|
||||
SDLTest_AssertPass("SDL_PROP_PROCESS_CREATE_CMDLINE_STRING only works on Windows");
|
||||
return TEST_SKIPPED;
|
||||
#endif
|
||||
|
||||
props = SDL_CreateProperties();
|
||||
SDLTest_AssertCheck(props != 0, "SDL_CreateProperties()");
|
||||
if (!props) {
|
||||
goto failed;
|
||||
}
|
||||
|
||||
SDL_snprintf(process_cmdline, SDL_arraysize(process_cmdline), process_cmdline_template, data->childprocess_path);
|
||||
SDL_SetPointerProperty(props, SDL_PROP_PROCESS_CREATE_ARGS_POINTER, (void *)process_args);
|
||||
SDL_SetStringProperty(props, SDL_PROP_PROCESS_CREATE_CMDLINE_STRING, (const char *)process_cmdline);
|
||||
SDL_SetNumberProperty(props, SDL_PROP_PROCESS_CREATE_STDIN_NUMBER, SDL_PROCESS_STDIO_APP);
|
||||
SDL_SetNumberProperty(props, SDL_PROP_PROCESS_CREATE_STDOUT_NUMBER, SDL_PROCESS_STDIO_APP);
|
||||
SDL_SetBooleanProperty(props, SDL_PROP_PROCESS_CREATE_STDERR_TO_STDOUT_BOOLEAN, true);
|
||||
|
||||
process = SDL_CreateProcessWithProperties(props);
|
||||
SDLTest_AssertCheck(process != NULL, "SDL_CreateProcessWithProperties()");
|
||||
if (!process) {
|
||||
goto failed;
|
||||
}
|
||||
|
||||
exit_code = 0xdeadbeef;
|
||||
buffer = (char *)SDL_ReadProcess(process, &total_read, &exit_code);
|
||||
SDLTest_AssertCheck(buffer != NULL, "SDL_ReadProcess()");
|
||||
SDLTest_AssertCheck(exit_code == 0, "Exit code should be 0, is %d", exit_code);
|
||||
if (!buffer) {
|
||||
goto failed;
|
||||
}
|
||||
SDLTest_LogEscapedString("stdout of process: ", buffer, total_read);
|
||||
SDLTest_AssertCheck(!!SDL_strstr(buffer, "|0=argument 2|"), "Check |0=argument 2| is printed");
|
||||
SDL_free(buffer);
|
||||
|
||||
SDLTest_AssertPass("About to destroy process");
|
||||
SDL_DestroyProcess(process);
|
||||
|
||||
return TEST_COMPLETED;
|
||||
|
||||
failed:
|
||||
SDL_DestroyProcess(process);
|
||||
return TEST_ABORTED;
|
||||
}
|
||||
|
||||
static const SDLTest_TestCaseReference processTestArguments = {
|
||||
process_testArguments, "process_testArguments", "Test passing arguments to child process", TEST_ENABLED
|
||||
};
|
||||
@@ -1017,6 +1176,14 @@ static const SDLTest_TestCaseReference processTestFileRedirection = {
|
||||
process_testFileRedirection, "process_testFileRedirection", "Test redirection from/to files", TEST_ENABLED
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference processTestWindowsCmdline = {
|
||||
process_testWindowsCmdline, "process_testWindowsCmdline", "Test passing cmdline directly to CreateProcess", TEST_ENABLED
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference processTestWindowsCmdlinePrecedence = {
|
||||
process_testWindowsCmdlinePrecedence, "process_testWindowsCmdlinePrecedence", "Test SDL_PROP_PROCESS_CREATE_CMDLINE_STRING precedence over SDL_PROP_PROCESS_CREATE_ARGS_POINTER", TEST_ENABLED
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference *processTests[] = {
|
||||
&processTestArguments,
|
||||
&processTestExitCode,
|
||||
@@ -1031,6 +1198,8 @@ static const SDLTest_TestCaseReference *processTests[] = {
|
||||
&processTestNonExistingExecutable,
|
||||
&processTestBatBadButVulnerability,
|
||||
&processTestFileRedirection,
|
||||
&processTestWindowsCmdline,
|
||||
&processTestWindowsCmdlinePrecedence,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
@@ -135,8 +135,8 @@ int main(int argc, char *argv[])
|
||||
|
||||
drawstate->window = state->windows[i];
|
||||
drawstate->renderer = state->renderers[i];
|
||||
drawstate->sprite = LoadTexture(drawstate->renderer, "icon.bmp", true, NULL, NULL);
|
||||
drawstate->background = LoadTexture(drawstate->renderer, "sample.bmp", false, NULL, NULL);
|
||||
drawstate->sprite = LoadTexture(drawstate->renderer, "icon.bmp", true);
|
||||
drawstate->background = LoadTexture(drawstate->renderer, "sample.bmp", false);
|
||||
if (!drawstate->sprite || !drawstate->background) {
|
||||
quit(2);
|
||||
}
|
||||
|
||||
@@ -253,11 +253,11 @@ int main(int argc, char *argv[])
|
||||
drawstate->window = state->windows[i];
|
||||
drawstate->renderer = state->renderers[i];
|
||||
if (test_composite) {
|
||||
drawstate->sprite = LoadTexture(drawstate->renderer, "icon-alpha.bmp", true, NULL, NULL);
|
||||
drawstate->sprite = LoadTexture(drawstate->renderer, "icon-alpha.bmp", true);
|
||||
} else {
|
||||
drawstate->sprite = LoadTexture(drawstate->renderer, "icon.bmp", true, NULL, NULL);
|
||||
drawstate->sprite = LoadTexture(drawstate->renderer, "icon.bmp", true);
|
||||
}
|
||||
drawstate->background = LoadTexture(drawstate->renderer, "sample.bmp", false, NULL, NULL);
|
||||
drawstate->background = LoadTexture(drawstate->renderer, "sample.bmp", false);
|
||||
if (!drawstate->sprite || !drawstate->background) {
|
||||
quit(2);
|
||||
}
|
||||
|
||||
@@ -126,12 +126,13 @@ int main(int argc, char *argv[])
|
||||
|
||||
drawstate->window = state->windows[i];
|
||||
drawstate->renderer = state->renderers[i];
|
||||
drawstate->sprite = LoadTexture(drawstate->renderer, "icon.bmp", true, NULL, NULL);
|
||||
drawstate->background = LoadTexture(drawstate->renderer, "sample.bmp", false, NULL, NULL);
|
||||
drawstate->sprite = LoadTexture(drawstate->renderer, "icon.bmp", true);
|
||||
drawstate->background = LoadTexture(drawstate->renderer, "sample.bmp", false);
|
||||
if (!drawstate->sprite || !drawstate->background) {
|
||||
quit(2);
|
||||
}
|
||||
SDL_GetTextureSize(drawstate->sprite, &drawstate->sprite_rect.w, &drawstate->sprite_rect.h);
|
||||
SDL_SetTextureScaleMode(drawstate->sprite, SDL_SCALEMODE_PIXELART);
|
||||
drawstate->scale_direction = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -53,16 +53,18 @@ void SDL_AppQuit(void *appstate, SDL_AppResult result)
|
||||
|
||||
static int LoadSprite(const char *file)
|
||||
{
|
||||
int i, w, h;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < state->num_windows; ++i) {
|
||||
/* This does the SDL_LoadBMP step repeatedly, but that's OK for test code. */
|
||||
if (sprites[i]) {
|
||||
SDL_DestroyTexture(sprites[i]);
|
||||
}
|
||||
sprites[i] = LoadTexture(state->renderers[i], file, true, &w, &h);
|
||||
sprite_w = (float)w;
|
||||
sprite_h = (float)h;
|
||||
sprites[i] = LoadTexture(state->renderers[i], file, true);
|
||||
if (sprites[i]) {
|
||||
sprite_w = (float)sprites[i]->w;
|
||||
sprite_h = (float)sprites[i]->h;
|
||||
}
|
||||
if (!sprites[i]) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ char *GetResourceFilename(const char *user_specified, const char *def)
|
||||
*
|
||||
* If height_out is non-NULL, set it to the texture height.
|
||||
*/
|
||||
SDL_Texture *LoadTexture(SDL_Renderer *renderer, const char *file, bool transparent, int *width_out, int *height_out)
|
||||
SDL_Texture *LoadTexture(SDL_Renderer *renderer, const char *file, bool transparent)
|
||||
{
|
||||
SDL_Surface *temp = NULL;
|
||||
SDL_Texture *texture = NULL;
|
||||
@@ -117,14 +117,6 @@ SDL_Texture *LoadTexture(SDL_Renderer *renderer, const char *file, bool transpar
|
||||
}
|
||||
}
|
||||
|
||||
if (width_out) {
|
||||
*width_out = temp->w;
|
||||
}
|
||||
|
||||
if (height_out) {
|
||||
*height_out = temp->h;
|
||||
}
|
||||
|
||||
texture = SDL_CreateTextureFromSurface(renderer, temp);
|
||||
if (!texture) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create texture: %s", SDL_GetError());
|
||||
|
||||
@@ -16,8 +16,7 @@
|
||||
|
||||
#include <SDL3/SDL.h>
|
||||
|
||||
SDL_Texture *LoadTexture(SDL_Renderer *renderer, const char *file, bool transparent,
|
||||
int *width_out, int *height_out);
|
||||
SDL_Texture *LoadTexture(SDL_Renderer *renderer, const char *file, bool transparent);
|
||||
char *GetNearbyFilename(const char *file);
|
||||
char *GetResourceFilename(const char *user_specified, const char *def);
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@ static bool use_target = false;
|
||||
static Uint32 wait_start;
|
||||
#endif
|
||||
static SDL_Texture *sprite;
|
||||
static int sprite_w, sprite_h;
|
||||
|
||||
/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
|
||||
static void
|
||||
@@ -184,8 +183,7 @@ int main(int argc, char *argv[])
|
||||
quit(2);
|
||||
}
|
||||
|
||||
sprite = LoadTexture(state->renderers[0], "icon.bmp", true, &sprite_w, &sprite_h);
|
||||
|
||||
sprite = LoadTexture(state->renderers[0], "icon.bmp", true);
|
||||
if (!sprite) {
|
||||
quit(2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user