diff --git a/CMakeLists.txt b/CMakeLists.txt index 131ec3fb..05e0cfc1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -101,6 +101,7 @@ endif() add_library(${sdl3_ttf_target_name} src/SDL_hashtable.c + src/SDL_gpu_textengine.c src/SDL_renderer_textengine.c src/SDL_surface_textengine.c src/SDL_ttf.c @@ -365,6 +366,9 @@ if(SDLTTF_SAMPLES) add_executable(glfont examples/glfont.c) add_executable(showfont examples/showfont.c examples/editbox.c) add_executable(testapp examples/testapp.c) + add_executable(testgputext examples/testgputext.c) + + file(COPY examples/testgputext/fonts/NotoSansMono-Regular.ttf DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) set(OpenGL_GL_PREFERENCE GLVND) find_package(OpenGL) @@ -376,7 +380,7 @@ if(SDLTTF_SAMPLES) target_link_libraries(glfont PRIVATE OpenGL::GL) endif() - foreach(prog glfont showfont testapp) + foreach(prog glfont showfont testapp testgputext) sdl_add_warning_options(${prog} WARNING_AS_ERROR ${SDLTTF_WERROR}) target_link_libraries(${prog} PRIVATE SDL3_ttf::${sdl3_ttf_target_name}) target_link_libraries(${prog} PRIVATE ${sdl3_target_name}) diff --git a/examples/testgputext.c b/examples/testgputext.c new file mode 100644 index 00000000..d8f27888 --- /dev/null +++ b/examples/testgputext.c @@ -0,0 +1,402 @@ +#include +#include +#include + +#include "testgputext/shaders/spir-v.h" +#include "testgputext/shaders/dxbc50.h" +#include "testgputext/shaders/dxil60.h" +#include "testgputext/shaders/metal.h" +#define SDL_MATH_3D_IMPLEMENTATION +#include "testgputext/SDL_math3d.h" + +#define MAX_VERTEX_COUNT 4000 +#define MAX_INDEX_COUNT 6000 +#define SUPPORTED_SHADER_FORMATS (SDL_GPU_SHADERFORMAT_SPIRV | SDL_GPU_SHADERFORMAT_DXBC | SDL_GPU_SHADERFORMAT_DXIL | SDL_GPU_SHADERFORMAT_METALLIB) + +typedef struct Vec2 +{ + float x, y; +} Vec2; + +typedef struct Vec3 +{ + float x, y, z; +} Vec3; + +typedef struct Vertex +{ + Vec3 pos; + SDL_FColor colour; + Vec2 uv; +} Vertex; + +typedef struct Context +{ + SDL_GPUDevice *device; + SDL_Window *window; + SDL_GPUGraphicsPipeline *pipeline; + SDL_GPUBuffer *vertex_buffer; + SDL_GPUBuffer *index_buffer; + SDL_GPUTransferBuffer *transfer_buffer; + SDL_GPUSampler *sampler; + SDL_GPUCommandBuffer *cmd_buf; +} Context; + +typedef struct GeometryData +{ + Vertex *vertices; + int vertex_count; + int *indices; + int index_count; +} GeometryData; + +void check_error_bool(const bool res) +{ + if (!res) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "%s", SDL_GetError()); + } +} + +void *check_error_ptr(void *ptr) +{ + if (!ptr) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "%s", SDL_GetError()); + } + + return ptr; +} + +SDL_GPUShader *load_shader( + SDL_GPUDevice *device, + bool is_vertex, + Uint32 sampler_count, + Uint32 uniform_buffer_count, + Uint32 storage_buffer_count, + Uint32 storage_texture_count) +{ + SDL_GPUShaderCreateInfo createinfo; + createinfo.num_samplers = sampler_count; + createinfo.num_storage_buffers = storage_buffer_count; + createinfo.num_storage_textures = storage_texture_count; + createinfo.num_uniform_buffers = uniform_buffer_count; + createinfo.props = 0; + + SDL_GPUShaderFormat format = SDL_GetGPUShaderFormats(device); + if (format & SDL_GPU_SHADERFORMAT_DXBC) { + createinfo.format = SDL_GPU_SHADERFORMAT_DXBC; + createinfo.code = (Uint8*)(is_vertex ? shader_vert_sm50_dxbc : shader_frag_sm50_dxbc); + createinfo.code_size = is_vertex ? SDL_arraysize(shader_vert_sm50_dxbc) : SDL_arraysize(shader_frag_sm50_dxbc); + createinfo.entrypoint = is_vertex ? "VSMain" : "PSMain"; + } else if (format & SDL_GPU_SHADERFORMAT_DXIL) { + createinfo.format = SDL_GPU_SHADERFORMAT_DXIL; + createinfo.code = is_vertex ? shader_vert_sm60_dxil : shader_frag_sm60_dxil; + createinfo.code_size = is_vertex ? SDL_arraysize(shader_vert_sm60_dxil) : SDL_arraysize(shader_frag_sm60_dxil); + createinfo.entrypoint = is_vertex ? "VSMain" : "PSMain"; + } else if (format & SDL_GPU_SHADERFORMAT_METALLIB) { + createinfo.format = SDL_GPU_SHADERFORMAT_METALLIB; + createinfo.code = is_vertex ? shader_vert_metal : shader_frag_metal; + createinfo.code_size = is_vertex ? shader_vert_metal_len : shader_frag_metal_len; + createinfo.entrypoint = is_vertex ? "vs_main" : "fs_main"; + } else { + createinfo.format = SDL_GPU_SHADERFORMAT_SPIRV; + createinfo.code = is_vertex ? shader_vert_spv : shader_frag_spv; + createinfo.code_size = is_vertex ? shader_vert_spv_len : shader_frag_spv_len; + createinfo.entrypoint = "main"; + } + + createinfo.stage = is_vertex ? SDL_GPU_SHADERSTAGE_VERTEX : SDL_GPU_SHADERSTAGE_FRAGMENT; + return SDL_CreateGPUShader(device, &createinfo); +} + +void queue_text_sequence(GeometryData *geometry_data, TTF_GPUAtlasDrawSequence *sequence, SDL_FColor *colour) +{ + for (int i = 0; i < sequence->num_vertices; i++) { + Vertex vert; + const float *xy = (float *)((Uint8 *)sequence->xy + i * sequence->xy_stride); + vert.pos = (Vec3){ xy[0], xy[1], 0.0f }; + + vert.colour = *colour; + + const float *uv = (float *)((Uint8 *)sequence->uv + i * sequence->uv_stride); + SDL_memcpy(&vert.uv, uv, 2 * sizeof(float)); + + geometry_data->vertices[geometry_data->vertex_count + i] = vert; + } + + SDL_memcpy(geometry_data->indices + geometry_data->index_count, sequence->indices, sequence->num_indices * sizeof(int)); + + geometry_data->vertex_count += sequence->num_vertices; + geometry_data->index_count += sequence->num_indices; +} + +void queue_text(GeometryData *geometry_data, TTF_GPUAtlasDrawSequence *sequence, SDL_FColor *colour) +{ + do { + queue_text_sequence(geometry_data, sequence, colour); + } while ((sequence = sequence->next)); +} + +void set_geometry_data(Context *context, GeometryData *geometry_data) +{ + Vertex *transfer_data = SDL_MapGPUTransferBuffer(context->device, context->transfer_buffer, false); + + SDL_memcpy(transfer_data, geometry_data->vertices, sizeof(Vertex) * geometry_data->vertex_count); + SDL_memcpy(transfer_data + MAX_VERTEX_COUNT, geometry_data->indices, sizeof(int) * geometry_data->index_count); + + SDL_UnmapGPUTransferBuffer(context->device, context->transfer_buffer); +} + +void transfer_data(Context *context, GeometryData *geometry_data) +{ + SDL_GPUCopyPass *copy_pass = check_error_ptr(SDL_BeginGPUCopyPass(context->cmd_buf)); + SDL_UploadToGPUBuffer( + copy_pass, + &(SDL_GPUTransferBufferLocation){ + .transfer_buffer = context->transfer_buffer, + .offset = 0 }, + &(SDL_GPUBufferRegion){ + .buffer = context->vertex_buffer, + .offset = 0, + .size = sizeof(Vertex) * geometry_data->vertex_count }, + false); + SDL_UploadToGPUBuffer( + copy_pass, + &(SDL_GPUTransferBufferLocation){ + .transfer_buffer = context->transfer_buffer, + .offset = sizeof(Vertex) * MAX_VERTEX_COUNT }, + &(SDL_GPUBufferRegion){ + .buffer = context->index_buffer, + .offset = 0, + .size = sizeof(int) * geometry_data->index_count }, + false); + SDL_EndGPUCopyPass(copy_pass); +} + +void draw(Context *context, SDL_Mat4X4 *matrices, int num_matrices, TTF_GPUAtlasDrawSequence *draw_sequence) +{ + SDL_GPUTexture *swapchain_texture; + check_error_bool(SDL_AcquireGPUSwapchainTexture(context->cmd_buf, context->window, &swapchain_texture, NULL, NULL)); + + if (swapchain_texture != NULL) { + SDL_GPUColorTargetInfo colour_target_info = { 0 }; + colour_target_info.texture = swapchain_texture; + colour_target_info.clear_color = (SDL_FColor){ 0.3f, 0.4f, 0.5f, 1.0f }; + colour_target_info.load_op = SDL_GPU_LOADOP_CLEAR; + colour_target_info.store_op = SDL_GPU_STOREOP_STORE; + + SDL_GPURenderPass *render_pass = SDL_BeginGPURenderPass(context->cmd_buf, &colour_target_info, 1, NULL); + + SDL_BindGPUGraphicsPipeline(render_pass, context->pipeline); + SDL_BindGPUVertexBuffers( + render_pass, 0, + &(SDL_GPUBufferBinding){ + .buffer = context->vertex_buffer, .offset = 0 }, + 1); + SDL_BindGPUIndexBuffer( + render_pass, + &(SDL_GPUBufferBinding){ + .buffer = context->index_buffer, .offset = 0 }, + SDL_GPU_INDEXELEMENTSIZE_32BIT); + SDL_PushGPUVertexUniformData(context->cmd_buf, 0, matrices, sizeof(SDL_Mat4X4) * num_matrices); + + int index_offset = 0; + for (TTF_GPUAtlasDrawSequence *seq = draw_sequence; seq != NULL; seq = seq->next) { + SDL_BindGPUFragmentSamplers( + render_pass, 0, + &(SDL_GPUTextureSamplerBinding){ + .texture = seq->atlas_texture, .sampler = context->sampler }, + 1); + + SDL_DrawGPUIndexedPrimitives(render_pass, seq->num_indices, 1, index_offset, 0, 0); + + index_offset += seq->num_indices; + } + SDL_EndGPURenderPass(render_pass); + } +} + +void free_context(Context *context) +{ + SDL_ReleaseGPUTransferBuffer(context->device, context->transfer_buffer); + SDL_ReleaseGPUSampler(context->device, context->sampler); + SDL_ReleaseGPUBuffer(context->device, context->vertex_buffer); + SDL_ReleaseGPUBuffer(context->device, context->index_buffer); + SDL_ReleaseGPUGraphicsPipeline(context->device, context->pipeline); + SDL_ReleaseWindowFromGPUDevice(context->device, context->window); + SDL_DestroyGPUDevice(context->device); + SDL_DestroyWindow(context->window); +} + +int main(int argc, char *argv[]) +{ + (void)argc; + (void)argv; + + check_error_bool(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_EVENTS)); + + bool running = true; + Context context = { 0 }; + + context.window = check_error_ptr(SDL_CreateWindow("GPU text test", 800, 600, 0)); + + context.device = check_error_ptr(SDL_CreateGPUDevice(SUPPORTED_SHADER_FORMATS, true, NULL)); + check_error_bool(SDL_ClaimWindowForGPUDevice(context.device, context.window)); + + SDL_GPUShader *vertex_shader = check_error_ptr(load_shader(context.device, true, 0, 1, 0, 0)); + SDL_GPUShader *fragment_shader = check_error_ptr(load_shader(context.device, false, 1, 0, 0, 0)); + + SDL_GPUGraphicsPipelineCreateInfo pipeline_create_info = { + .target_info = { + .num_color_targets = 1, + .color_target_descriptions = (SDL_GPUColorTargetDescription[]){{ + .format = SDL_GetGPUSwapchainTextureFormat(context.device, context.window), + .blend_state = (SDL_GPUColorTargetBlendState){ + .enable_blend = true, + .alpha_blend_op = SDL_GPU_BLENDOP_ADD, + .color_blend_op = SDL_GPU_BLENDOP_ADD, + .color_write_mask = 0xF, + .src_alpha_blendfactor = SDL_GPU_BLENDFACTOR_SRC_ALPHA, + .dst_alpha_blendfactor = SDL_GPU_BLENDFACTOR_DST_ALPHA, + .src_color_blendfactor = SDL_GPU_BLENDFACTOR_SRC_ALPHA, + .dst_color_blendfactor = SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA + } + }}, + .has_depth_stencil_target = false, + .depth_stencil_format = SDL_GPU_TEXTUREFORMAT_INVALID /* Need to set this to avoid missing initializer for field error */ + }, + .vertex_input_state = (SDL_GPUVertexInputState){ + .num_vertex_buffers = 1, + .vertex_buffer_descriptions = (SDL_GPUVertexBufferDescription[]){{ + .slot = 0, + .input_rate = SDL_GPU_VERTEXINPUTRATE_VERTEX, + .instance_step_rate = 0, + .pitch = sizeof(Vertex) + }}, + .num_vertex_attributes = 3, + .vertex_attributes = (SDL_GPUVertexAttribute[]){{ + .buffer_slot = 0, + .format = SDL_GPU_VERTEXELEMENTFORMAT_FLOAT3, + .location = 0, + .offset = 0 + }, { + .buffer_slot = 0, + .format = SDL_GPU_VERTEXELEMENTFORMAT_FLOAT4, + .location = 1, + .offset = sizeof(float) * 3 + }, { + .buffer_slot = 0, + .format = SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2, + .location = 2, + .offset = sizeof(float) * 7 + }} + }, + .primitive_type = SDL_GPU_PRIMITIVETYPE_TRIANGLELIST, + .vertex_shader = vertex_shader, + .fragment_shader = fragment_shader + }; + context.pipeline = check_error_ptr(SDL_CreateGPUGraphicsPipeline(context.device, &pipeline_create_info)); + + SDL_ReleaseGPUShader(context.device, vertex_shader); + SDL_ReleaseGPUShader(context.device, fragment_shader); + + SDL_GPUBufferCreateInfo vbf_info = { + .usage = SDL_GPU_BUFFERUSAGE_VERTEX, + .size = sizeof(Vertex) * MAX_VERTEX_COUNT + }; + context.vertex_buffer = check_error_ptr(SDL_CreateGPUBuffer(context.device, &vbf_info)); + + SDL_GPUBufferCreateInfo ibf_info = { + .usage = SDL_GPU_BUFFERUSAGE_INDEX, + .size = sizeof(int) * MAX_INDEX_COUNT + }; + context.index_buffer = check_error_ptr(SDL_CreateGPUBuffer(context.device, &ibf_info)); + + SDL_GPUTransferBufferCreateInfo tbf_info = { + .usage = SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD, + .size = (sizeof(Vertex) * MAX_VERTEX_COUNT) + (sizeof(int) * MAX_INDEX_COUNT) + }; + context.transfer_buffer = check_error_ptr(SDL_CreateGPUTransferBuffer(context.device, &tbf_info)); + + SDL_GPUSamplerCreateInfo sampler_info = { + .min_filter = SDL_GPU_FILTER_LINEAR, + .mag_filter = SDL_GPU_FILTER_LINEAR, + .mipmap_mode = SDL_GPU_SAMPLERMIPMAPMODE_LINEAR, + .address_mode_u = SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE, + .address_mode_v = SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE, + .address_mode_w = SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE + }; + context.sampler = check_error_ptr(SDL_CreateGPUSampler(context.device, &sampler_info)); + + GeometryData geometry_data = { 0 }; + geometry_data.vertices = SDL_calloc(MAX_VERTEX_COUNT, sizeof(Vertex)); + geometry_data.indices = SDL_calloc(MAX_INDEX_COUNT, sizeof(int)); + + check_error_bool(TTF_Init()); + TTF_Font *font = check_error_ptr(TTF_OpenFont("NotoSansMono-Regular.ttf", 50)); + TTF_SetFontWrapAlignment(font, TTF_HORIZONTAL_ALIGN_CENTER); + TTF_TextEngine *engine = check_error_ptr(TTF_CreateGPUTextEngine(context.device)); + + SDL_Mat4X4 *matrices = (SDL_Mat4X4[]){ + SDL_MatrixPerspective(SDL_PI_F / 2.0f, 800.0f / 600.0f, 0.1f, 100.0f), + SDL_MatrixIdentity() + }; + + float rot_angle = 0; + char str[] = " \nSDL is cool"; + SDL_FColor colour = {1.0f, 1.0f, 0.0f, 1.0f}; + + while (running) { + SDL_Event event; + while (SDL_PollEvent(&event)) { + switch (event.type) { + case SDL_EVENT_QUIT: + running = false; + break; + } + } + + for (int i = 0; i < 5; i++) { + str[i] = 65 + SDL_rand(26); + } + + rot_angle = SDL_fmodf(rot_angle + 0.01, 2 * SDL_PI_F); + + int tw, th; + TTF_Text *text = check_error_ptr(TTF_CreateText(engine, font, str, 0)); + check_error_bool(TTF_GetTextSize(text, &tw, &th)); + TTF_SetTextWrapWidth(text, 0); + + // Create a model matrix to make the text rotate + SDL_Mat4X4 model; + model = SDL_MatrixIdentity(); + model = SDL_MatrixMultiply(model, SDL_MatrixTranslation((SDL_Vec3){ 0.0f, 0.0f, -80.0f })); + model = SDL_MatrixMultiply(model, SDL_MatrixScaling((SDL_Vec3){ 0.3f, 0.3f, 0.3f})); + model = SDL_MatrixMultiply(model, SDL_MatrixRotationY(rot_angle)); + model = SDL_MatrixMultiply(model, SDL_MatrixTranslation((SDL_Vec3){ -tw / 2.0f, th / 2.0f, 0.0f })); + matrices[1] = model; + + // Get the text data and queue the text in a buffer for drawing later + TTF_GPUAtlasDrawSequence *sequence = TTF_GetGPUTextDrawData(text); + queue_text(&geometry_data, sequence, &colour); + + set_geometry_data(&context, &geometry_data); + + context.cmd_buf = check_error_ptr(SDL_AcquireGPUCommandBuffer(context.device)); + transfer_data(&context, &geometry_data); + draw(&context, matrices, 2, sequence); + SDL_SubmitGPUCommandBuffer(context.cmd_buf); + + geometry_data.vertex_count = 0; + geometry_data.index_count = 0; + + TTF_DestroyText(text); + } + + SDL_free(geometry_data.vertices); + SDL_free(geometry_data.indices); + TTF_DestroyGPUTextEngine(engine); + free_context(&context); + SDL_Quit(); + + return 0; +} diff --git a/examples/testgputext/SDL_math3d.h b/examples/testgputext/SDL_math3d.h new file mode 100644 index 00000000..60116abb --- /dev/null +++ b/examples/testgputext/SDL_math3d.h @@ -0,0 +1,309 @@ +/** + * Define SDL_MATH_3D_IMPLEMENTATION before including this header in any one source (.c) files. + * Angles are in radians unless specified otherwise. +**/ + +#ifndef SDL_MATH_3D_H +#define SDL_MATH_3D_H + +#include + +// Set up for C function definitions, even when using C++ +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct +{ + float x; + float y; +} SDL_Vec2; + +typedef struct +{ + float x; + float y; + float z; +} SDL_Vec3; + +typedef struct +{ + float x; + float y; + float z; + float w; +} SDL_Vec4; + +/** + * The matrix is stored in column major format + **/ +typedef struct +{ + union + { + struct + { + float m00, m01, m02, m03; + float m10, m11, m12, m13; + float m20, m21, m22, m23; + float m30, m31, m32, m33; + } v; + float m[4][4]; + }; +} SDL_Mat4X4; + + +// SDL Vector functions +static inline SDL_Vec3 SDL_Vector3(float x, float y, float z); +static inline float SDL_Vec3Magnitude(SDL_Vec3 vec); +static inline SDL_Vec3 SDL_Vec3Normalize(SDL_Vec3 vec); +static inline SDL_Vec3 SDL_Vec3Add(SDL_Vec3 vec1, SDL_Vec3 vec2); +static inline SDL_Vec3 SDL_Vec3Sub(SDL_Vec3 vec1, SDL_Vec3 vec2); +static inline SDL_Vec3 SDL_Vec3MultiplyFloat(SDL_Vec3 vec, float val); +static inline float SDL_Vec3Dot(SDL_Vec3 vec1, SDL_Vec3 vec2); +static inline SDL_Vec3 SDL_Vec3Cross(SDL_Vec3 vec1, SDL_Vec3 vec2); + +// SDL Matrix functions +static inline SDL_Mat4X4 SDL_Matrix4X4( + float m00, float m10, float m20, float m30, + float m01, float m11, float m21, float m31, + float m02, float m12, float m22, float m32, + float m03, float m13, float m23, float m33 +); +static inline SDL_Mat4X4 SDL_MatrixIdentity(void); +static inline SDL_Mat4X4 SDL_MatrixTranspose(SDL_Mat4X4 mat); +static inline SDL_Mat4X4 SDL_MatrixMultiply(SDL_Mat4X4 mat1, SDL_Mat4X4 mat2); +static inline SDL_Mat4X4 SDL_MatrixScaling(SDL_Vec3 scale); +static inline SDL_Mat4X4 SDL_MatrixTranslation(SDL_Vec3 offset); +static inline SDL_Mat4X4 SDL_MatrixRotationX(float angle); +static inline SDL_Mat4X4 SDL_MatrixRotationY(float angle); +static inline SDL_Mat4X4 SDL_MatrixRotationZ(float angle); + +static inline SDL_Mat4X4 SDL_MatrixOrtho(float left, float right, float bottom, float top, float back, float front); +static inline SDL_Mat4X4 SDL_MatrixPerspective(float fovy, float aspect_ratio, float near, float far); +static inline SDL_Mat4X4 SDL_MatrixLookAt(SDL_Vec3 pos, SDL_Vec3 target, SDL_Vec3 up); + + +// Ends C function definitions when using C++ +#ifdef __cplusplus +} +#endif +#endif /* SDL_MATH_3D_H */ + + +#ifdef SDL_MATH_3D_IMPLEMENTATION + +static inline SDL_Vec3 SDL_Vector3(float x, float y, float z) { + return (SDL_Vec3) {.x = x, .y = y, .z = z}; +} + +static inline float SDL_Vec3Magnitude(SDL_Vec3 vec) +{ + return SDL_sqrtf(vec.x*vec.x + vec.y*vec.y + vec.z*vec.z); +} + + +static inline SDL_Vec3 SDL_Vec3Normalize(SDL_Vec3 vec) +{ + float mag = SDL_Vec3Magnitude(vec); + + if (mag == 0) { + return (SDL_Vec3) {0, 0, 0}; + } else if (mag == 1){ + return vec; + } else { + return (SDL_Vec3) {vec.x/mag, vec.y/mag, vec.z/mag}; + } +} + +static inline SDL_Vec3 SDL_Vec3Add(SDL_Vec3 vec1, SDL_Vec3 vec2) +{ + return SDL_Vector3(vec1.x + vec2.x, vec1.y + vec2.y, vec1.z + vec2.z); +} + +static inline SDL_Vec3 SDL_Vec3Sub(SDL_Vec3 vec1, SDL_Vec3 vec2) +{ + return SDL_Vector3(vec1.x - vec2.x, vec1.y - vec2.y, vec1.z - vec2.z); +} + +static inline SDL_Vec3 SDL_Vec3MultiplyFloat(SDL_Vec3 vec, float val) +{ + return SDL_Vector3(vec.x * val, vec.y * val, vec.z * val); +} + +static inline float SDL_Vec3Dot(SDL_Vec3 vec1, SDL_Vec3 vec2) +{ + return (vec1.x * vec2.x + vec1.y * vec2.y + vec1.y * vec2.y); +} + +static inline SDL_Vec3 SDL_Vec3Cross(SDL_Vec3 vec1, SDL_Vec3 vec2) { + return SDL_Vector3( + vec1.y * vec2.z - vec1.z * vec2.y, + vec1.z * vec2.x - vec1.x * vec2.z, + vec1.x * vec2.y - vec1.y * vec2.x + ); +} + + +static inline SDL_Mat4X4 SDL_Matrix4X4( + float m00, float m10, float m20, float m30, + float m01, float m11, float m21, float m31, + float m02, float m12, float m22, float m32, + float m03, float m13, float m23, float m33 +) { + return (SDL_Mat4X4) { + .m[0][0] = m00, .m[1][0] = m10, .m[2][0] = m20, .m[3][0] = m30, + .m[0][1] = m01, .m[1][1] = m11, .m[2][1] = m21, .m[3][1] = m31, + .m[0][2] = m02, .m[1][2] = m12, .m[2][2] = m22, .m[3][2] = m32, + .m[0][3] = m03, .m[1][3] = m13, .m[2][3] = m23, .m[3][3] = m33 + }; +} + +static inline SDL_Mat4X4 SDL_MatrixIdentity(void) +{ + return SDL_Matrix4X4( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1 + ); +} + +static inline SDL_Mat4X4 SDL_MatrixTranspose(SDL_Mat4X4 mat) +{ + SDL_Mat4X4 res; + + for (int i = 0; i < 4; i++) { + for (int j = 0; j < 4; j++) { + res.m[i][j] = mat.m[i][j]; + } + } + + return res; +} + +static inline SDL_Mat4X4 SDL_MatrixMultiply(SDL_Mat4X4 mat1, SDL_Mat4X4 mat2) +{ + SDL_Mat4X4 res; + + for (int i = 0; i < 4; i++) { + for (int j = 0; j < 4; j++) { + float sum = 0; + for (int x = 0; x < 4; x++) { + sum += mat1.m[x][j] * mat2.m[i][x]; + } + res.m[i][j] = sum; + } + } + + return res; +} + +static inline SDL_Mat4X4 SDL_MatrixScaling(SDL_Vec3 scale) +{ + float x = scale.x, y = scale.y, z = scale.z; + return SDL_Matrix4X4( + x, 0, 0, 0, + 0, y, 0, 0, + 0, 0, z, 0, + 0, 0, 0, 1 + ); +} + +static inline SDL_Mat4X4 SDL_MatrixTranslation(SDL_Vec3 offset) +{ + return SDL_Matrix4X4( + 1, 0, 0, offset.x, + 0, 1, 0, offset.y, + 0, 0, 1, offset.z, + 0, 0, 0, 1 + ); +} + +static inline SDL_Mat4X4 SDL_MatrixRotationX(float angle) +{ + float cos = SDL_cos(angle); + float sin = SDL_sin(angle); + + return SDL_Matrix4X4( + 1, 0, 0, 0, + 0, cos, -sin, 0, + 0, sin, cos, 0, + 0, 0, 0, 1 + ); +} + +static inline SDL_Mat4X4 SDL_MatrixRotationY(float angle) +{ + float cos = SDL_cos(angle); + float sin = SDL_sin(angle); + + return SDL_Matrix4X4( + cos, 0, sin, 0, + 0, 1, 0, 0, + -sin, 0, cos, 0, + 0, 0, 0, 1 + ); +} + +static inline SDL_Mat4X4 SDL_MatrixRotationZ(float angle) +{ + float cos = SDL_cos(angle); + float sin = SDL_sin(angle); + + return SDL_Matrix4X4( + cos, -sin, 0, 0, + sin, cos, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1 + ); +} + +static inline SDL_Mat4X4 SDL_MatrixOrtho(float left, float right, float bottom, float top, float near, float far) +{ + float l = left, r = right, b = bottom, t = top, n = near, f = far; + + float dx = -(r + l) / (r - l); + float dy = -(t + b) / (t - b); + float dz = -(f + n) / (f - n); + + return SDL_Matrix4X4( + 2 / (r - l), 0, 0, dx, + 0, 2 / (t - b), 0, dy, + 0, 0, 2 / (f - n), dz, + 0, 0, 0, 1 + ); +} + +static inline SDL_Mat4X4 SDL_MatrixPerspective(float fovy, float aspect_ratio, float near, float far) +{ + float n = near; float f = far; + float t = SDL_tanf(fovy/2.0f) * n; + float b = -t; + float r = t * aspect_ratio; + float l = -r; + + return SDL_Matrix4X4( + (2 * n) / (r - l), 0, (r + l) / (r - l), 0, + 0, (2 * n) / (t - b), (t + b) / (t - b), 0, + 0, 0, -(f + n) / (f - n), -(2 * n * f) / (f - n), + 0, 0, -1, 1 + ); +} + +static inline SDL_Mat4X4 SDL_MatrixLookAt(SDL_Vec3 pos, SDL_Vec3 target, SDL_Vec3 up) +{ + SDL_Vec3 d = SDL_Vec3Normalize(SDL_Vec3Sub(target, pos)); + SDL_Vec3 u = SDL_Vec3Normalize(up); + SDL_Vec3 r = SDL_Vec3Normalize(SDL_Vec3Cross(u, d)); + u = SDL_Vec3Cross(r, d); + + return SDL_Matrix4X4( + r.x, r.y, r.z, -SDL_Vec3Dot(r, pos), + u.x, u.y, u.z, -SDL_Vec3Dot(u, pos), + -d.x, -d.y, -d.z, SDL_Vec3Dot(d, pos), + 0, 0, 0, 1 + ); +} + +#endif /* SDL_MATH_3D_IMPLEMENTATION */ diff --git a/examples/testgputext/fonts/NotoSansMono-Regular.ttf b/examples/testgputext/fonts/NotoSansMono-Regular.ttf new file mode 100644 index 00000000..c2bbb5a3 Binary files /dev/null and b/examples/testgputext/fonts/NotoSansMono-Regular.ttf differ diff --git a/examples/testgputext/fonts/license.txt b/examples/testgputext/fonts/license.txt new file mode 100644 index 00000000..067af543 --- /dev/null +++ b/examples/testgputext/fonts/license.txt @@ -0,0 +1,37 @@ +License +Copyright 2022 The Noto Project Authors (https://github.com/notofonts/latin-greek-cyrillic) + +This Font Software is licensed under the SIL Open Font License, Version 1.1 . This license is copied below, and is also available with a FAQ at: https://openfontlicense.org + +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +PREAMBLE + +The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others. + +The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives. +DEFINITIONS + +"Font Software" refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the copyright statement(s). +"Original Version" refers to the collection of Font Software components as distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, or substituting -- in part or in whole -- any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment. + +"Author" refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software. +PERMISSION & CONDITIONS + +Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions: + + Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself. + Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user. + No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users. + The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission. + The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software. + +TERMINATION + +This license becomes null and void if any of the above conditions are not met. +DISCLAIMER + +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/examples/testgputext/shaders/build-shaders.sh b/examples/testgputext/shaders/build-shaders.sh new file mode 100755 index 00000000..9b019e59 --- /dev/null +++ b/examples/testgputext/shaders/build-shaders.sh @@ -0,0 +1,106 @@ +#!/usr/bin/env bash + +set -e + +# NOTE: fxc is tested on Linux with https://github.com/mozilla/fxc2 + +which fxc &>/dev/null && HAVE_FXC=1 || HAVE_FXC=0 +which dxc &>/dev/null && HAVE_DXC=1 || HAVE_DXC=0 +which spirv-cross &>/dev/null && HAVE_SPIRV_CROSS=1 || HAVE_SPIRV_CROSS=0 + +[ "$HAVE_FXC" != 0 ] || echo "fxc not in PATH; D3D11 shaders will not be rebuilt" +[ "$HAVE_DXC" != 0 ] || echo "dxc not in PATH; D3D12 shaders will not be rebuilt" +[ "$HAVE_SPIRV_CROSS" != 0 ] || echo "spirv-cross not in PATH; D3D11, D3D12, Metal shaders will not be rebuilt" + +USE_FXC=${USE_FXC:-$HAVE_FXC} +USE_DXC=${USE_DXC:-$HAVE_DXC} +USE_SPIRV_CROSS=${USE_SPIRV_CROSS:-$HAVE_SPIRV_CROSS} + +spirv_bundle="spir-v.h" +dxbc50_bundle="dxbc50.h" +dxil60_bundle="dxil60.h" +metal_bundle="metal.h" + +rm -f "$spirv_bundle" +[ "$USE_SPIRV_CROSS" != 0 ] && rm -f "$metal_bundle" +[ "$USE_SPIRV_CROSS" != 0 ] && [ "$USE_FXC" != 0 ] && rm -f "$dxbc50_bundle" +[ "$USE_SPIRV_CROSS" != 0 ] && [ "$USE_DXC" != 0 ] && rm -f "$dxil60_bundle" + +make-header() { + xxd -i "$1" | sed \ + -e 's/^unsigned /const unsigned /g' \ + -e 's,^const,static const,' \ + > "$1.h" +} + +compile-hlsl-dxbc() { + local src="$1" + local profile="$2" + local output_basename="$3" + local var_name="$(echo "$output_basename" | sed -e 's/\./_/g')" + + fxc "$src" /E main /T $2 /Fh "$output_basename.tmp.h" || exit $? + sed \ + -e "s/g_main/$var_name/;s/\r//g" \ + -e 's,^const,static const,' \ + -e 's,const unsigned,const signed,' \ + < "$output_basename.tmp.h" \ + > "$output_basename.h" + rm -f "$output_basename.tmp.h" +} + +compile-hlsl-dxil() { + local src="$1" + local profile="$2" + local output_basename="$3" + local var_name="$(echo "$output_basename" | sed -e 's/\./_/g')" + + dxc "$src" -E main -T $2 -Fh "$output_basename.tmp.h" -O3 || exit $? + sed \ + -e "s/g_main/$var_name/;s/\r//g" \ + -e 's,^const,static const,' \ + < "$output_basename.tmp.h" \ + > "$output_basename.h" + rm -f "$output_basename.tmp.h" +} + +for i in *.vert *.frag; do + spv="$i.spv" + metal="$i.metal" + hlsl50="$i.sm50.hlsl" + dxbc50="$i.sm50.dxbc" + hlsl60="$i.sm60.hlsl" + dxil60="$i.sm60.dxil" + + glslangValidator -g0 -Os "$i" -V -o "$spv" --quiet + + make-header "$spv" + echo "#include \"$spv.h\"" >> "$spirv_bundle" + + if [ "$USE_SPIRV_CROSS" = "0" ]; then + continue + fi + + spirv-cross "$spv" --hlsl --shader-model 50 --hlsl-enable-compat --output "$hlsl50" + spirv-cross "$spv" --hlsl --shader-model 60 --hlsl-enable-compat --output "$hlsl60" + + if [ "${i##*.}" == "frag" ]; then + hlsl_stage="ps" + else + hlsl_stage="vs" + fi + + if [ "$USE_FXC" != "0" ]; then + compile-hlsl-dxbc "$hlsl50" ${hlsl_stage}_5_0 "$dxbc50" + echo "#include \"$dxbc50.h\"" >> "$dxbc50_bundle" + fi + + if [ "$USE_DXC" != "0" ]; then + compile-hlsl-dxil "$hlsl60" ${hlsl_stage}_6_0 "$dxil60" + echo "#include \"$dxil60.h\"" >> "$dxil60_bundle" + fi + + spirv-cross "$spv" --msl --output "$metal" + make-header "$metal" + echo "#include \"$metal.h\"" >> "$metal_bundle" +done diff --git a/examples/testgputext/shaders/dxbc50.h b/examples/testgputext/shaders/dxbc50.h new file mode 100644 index 00000000..81e460ba --- /dev/null +++ b/examples/testgputext/shaders/dxbc50.h @@ -0,0 +1,2 @@ +#include "shader.vert.sm50.dxbc.h" +#include "shader.frag.sm50.dxbc.h" diff --git a/examples/testgputext/shaders/dxil60.h b/examples/testgputext/shaders/dxil60.h new file mode 100644 index 00000000..0327232d --- /dev/null +++ b/examples/testgputext/shaders/dxil60.h @@ -0,0 +1,2 @@ +#include "shader.vert.sm60.dxil.h" +#include "shader.frag.sm60.dxil.h" diff --git a/examples/testgputext/shaders/metal.h b/examples/testgputext/shaders/metal.h new file mode 100644 index 00000000..894722cc --- /dev/null +++ b/examples/testgputext/shaders/metal.h @@ -0,0 +1,2 @@ +#include "shader.vert.metal.h" +#include "shader.frag.metal.h" diff --git a/examples/testgputext/shaders/shader.frag b/examples/testgputext/shaders/shader.frag new file mode 100644 index 00000000..291b5de0 --- /dev/null +++ b/examples/testgputext/shaders/shader.frag @@ -0,0 +1,13 @@ +#version 450 + +layout (location = 0) in vec4 vcolour; +layout (location = 1) in vec2 tex_coord; + +layout (location = 0) out vec4 frag_colour; + +layout (set = 2, binding = 0) uniform sampler2D tex; + + +void main() { + frag_colour = vcolour * texture(tex, tex_coord); +} diff --git a/examples/testgputext/shaders/shader.frag.metal b/examples/testgputext/shaders/shader.frag.metal new file mode 100644 index 00000000..00cc5f44 --- /dev/null +++ b/examples/testgputext/shaders/shader.frag.metal @@ -0,0 +1,23 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 m_9 [[color(0)]]; +}; + +struct main0_in +{ + float4 m_11 [[user(locn0)]]; + float2 m_20 [[user(locn1)]]; +}; + +fragment main0_out main0(main0_in in [[stage_in]], texture2d _16 [[texture(0)]], sampler _16Smplr [[sampler(0)]]) +{ + main0_out out = {}; + out.m_9 = in.m_11 * _16.sample(_16Smplr, in.m_20); + return out; +} + diff --git a/examples/testgputext/shaders/shader.frag.metal.h b/examples/testgputext/shaders/shader.frag.metal.h new file mode 100644 index 00000000..4aed2240 --- /dev/null +++ b/examples/testgputext/shaders/shader.frag.metal.h @@ -0,0 +1,40 @@ +static const unsigned char shader_frag_metal[] = { + 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, 0x6d, 0x5f, 0x39, 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, 0x6d, 0x5f, 0x31, + 0x31, 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, 0x6d, 0x5f, 0x32, 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, 0x5f, 0x31, 0x36, 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, 0x5f, 0x31, 0x36, 0x53, + 0x6d, 0x70, 0x6c, 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, 0x6f, 0x75, 0x74, 0x2e, 0x6d, 0x5f, 0x39, 0x20, 0x3d, + 0x20, 0x69, 0x6e, 0x2e, 0x6d, 0x5f, 0x31, 0x31, 0x20, 0x2a, 0x20, 0x5f, + 0x31, 0x36, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x5f, 0x31, + 0x36, 0x53, 0x6d, 0x70, 0x6c, 0x72, 0x2c, 0x20, 0x69, 0x6e, 0x2e, 0x6d, + 0x5f, 0x32, 0x30, 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 shader_frag_metal_len = 433; diff --git a/examples/testgputext/shaders/shader.frag.sm50.dxbc.h b/examples/testgputext/shaders/shader.frag.sm50.dxbc.h new file mode 100644 index 00000000..575b4f2c --- /dev/null +++ b/examples/testgputext/shaders/shader.frag.sm50.dxbc.h @@ -0,0 +1,100 @@ +static const signed char shader_frag_sm50_dxbc[] = +{ + 68, 88, 66, 67, -1, 20, + 65, 76, -24, -32, -71, 65, + 93, 71,-103, -84, -31, -14, + -22, 35, 1, 0, 0, 0, + 64, 2, 0, 0, 4, 0, + 0, 0, 48, 0, 0, 0, +-120, 0, 0, 0, -68, 0, + 0, 0, 104, 1, 0, 0, + 73, 83, 71, 78, 80, 0, + 0, 0, 2, 0, 0, 0, + 8, 0, 0, 0, 56, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 15, 15, 0, 0, 68, 0, + 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 1, 0, 0, 0, + 3, 3, 0, 0, 84, 69, + 88, 67, 79, 79, 82, 68, + 0, -85, -85, -85, 84, 69, + 88, 67, 79, 79, 82, 68, + 0, -85, -85, -85, 79, 83, + 71, 78, 44, 0, 0, 0, + 1, 0, 0, 0, 8, 0, + 0, 0, 32, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 15, 0, + 0, 0, 83, 86, 95, 84, + 97, 114, 103, 101, 116, 0, + -85, -85, 82, 68, 69, 70, + -92, 0, 0, 0, 0, 0, + 0, 0,-112, 0, 0, 0, + 2, 0, 0, 0, 60, 0, + 0, 0, 0, 5, -1, -1, + 0, 0, 0, 0,-112, 0, + 0, 0, 82, 68, 49, 49, + 60, 0, 0, 0, 24, 0, + 0, 0, 32, 0, 0, 0, + 40, 0, 0, 0, 36, 0, + 0, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 124, 0, + 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, +-116, 0, 0, 0, 2, 0, + 0, 0, 5, 0, 0, 0, + 4, 0, 0, 0, -1, -1, + -1, -1, 0, 0, 0, 0, + 1, 0, 0, 0, 12, 0, + 0, 0, 95, 95, 49, 54, + 95, 115, 97, 109, 112, 108, + 101, 114, 0, -85, -85, -85, + 95, 49, 54, 0, 118, 107, + 100, 51, 100, 45, 115, 104, + 97, 100, 101, 114, 32, 49, + 46, 49, 48, 0, -85, -85, + 83, 72, 68, 82, -48, 0, + 0, 0, 80, 0, 0, 0, + 52, 0, 0, 0, 90, 0, + 0, 3, 0, 96, 16, 0, + 0, 0, 0, 0, 88, 24, + 0, 4, 0, 112, 16, 0, + 0, 0, 0, 0, 85, 85, + 0, 0, 98, 16, 0, 3, + -14, 16, 16, 0, 0, 0, + 0, 0, 98, 16, 0, 3, + 50, 16, 16, 0, 1, 0, + 0, 0, 101, 0, 0, 3, + -14, 32, 16, 0, 0, 0, + 0, 0, 104, 0, 0, 2, + 2, 0, 0, 0, 54, 0, + 0, 5, 50, 0, 16, 0, + 0, 0, 0, 0, 70, 16, + 16, 0, 1, 0, 0, 0, + 54, 0, 0, 5, -14, 0, + 16, 0, 1, 0, 0, 0, + 70, 30, 16, 0, 0, 0, + 0, 0, 69, 0, 0, 9, + -14, 0, 16, 0, 0, 0, + 0, 0, 70, 0, 16, 0, + 0, 0, 0, 0, 70, 126, + 16, 0, 0, 0, 0, 0, + 0, 96, 16, 0, 0, 0, + 0, 0, 56, 0, 0, 7, + -14, 0, 16, 0, 0, 0, + 0, 0, 70, 14, 16, 0, + 1, 0, 0, 0, 70, 14, + 16, 0, 0, 0, 0, 0, + 54, 0, 0, 5, -14, 32, + 16, 0, 0, 0, 0, 0, + 70, 14, 16, 0, 0, 0, + 0, 0, 62, 0, 0, 1 + +}; diff --git a/examples/testgputext/shaders/shader.frag.sm50.hlsl b/examples/testgputext/shaders/shader.frag.sm50.hlsl new file mode 100644 index 00000000..c541c13b --- /dev/null +++ b/examples/testgputext/shaders/shader.frag.sm50.hlsl @@ -0,0 +1,32 @@ +Texture2D _16 : register(t0); +SamplerState __16_sampler : register(s0); + +static float4 _9; +static float4 _11; +static float2 _20; + +struct SPIRV_Cross_Input +{ + float4 _11 : TEXCOORD0; + float2 _20 : TEXCOORD1; +}; + +struct SPIRV_Cross_Output +{ + float4 _9 : SV_Target0; +}; + +void frag_main() +{ + _9 = _11 * _16.Sample(__16_sampler, _20); +} + +SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) +{ + _11 = stage_input._11; + _20 = stage_input._20; + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output._9 = _9; + return stage_output; +} diff --git a/examples/testgputext/shaders/shader.frag.sm60.dxil.h b/examples/testgputext/shaders/shader.frag.sm60.dxil.h new file mode 100644 index 00000000..39144aa9 --- /dev/null +++ b/examples/testgputext/shaders/shader.frag.sm60.dxil.h @@ -0,0 +1,467 @@ +#if 0 +; +; Input signature: +; +; Name Index Mask Register SysValue Format Used +; -------------------- ----- ------ -------- -------- ------- ------ +; TEXCOORD 0 xyzw 0 NONE float xyzw +; TEXCOORD 1 xy 1 NONE float xy +; +; +; Output signature: +; +; Name Index Mask Register SysValue Format Used +; -------------------- ----- ------ -------- -------- ------- ------ +; SV_Target 0 xyzw 0 TARGET float xyzw +; +; shader hash: ab99026f3068b3314341ba15eaf626a8 +; +; Pipeline Runtime Information: +; +; Pixel Shader +; DepthOutput=0 +; SampleFrequency=0 +; +; +; Input signature: +; +; Name Index InterpMode DynIdx +; -------------------- ----- ---------------------- ------ +; TEXCOORD 0 linear +; TEXCOORD 1 linear +; +; Output signature: +; +; Name Index InterpMode DynIdx +; -------------------- ----- ---------------------- ------ +; SV_Target 0 +; +; Buffer Definitions: +; +; +; Resource Bindings: +; +; Name Type Format Dim ID HLSL Bind Count +; ------------------------------ ---------- ------- ----------- ------- -------------- ------ +; __16_sampler sampler NA NA S0 s0,space2 1 +; _16 texture f32 2d T0 t0,space2 1 +; +; +; ViewId state: +; +; Number of inputs: 6, outputs: 4 +; Outputs dependent on ViewId: { } +; Inputs contributing to computation of Outputs: +; output 0 depends on inputs: { 0, 4, 5 } +; output 1 depends on inputs: { 1, 4, 5 } +; output 2 depends on inputs: { 2, 4, 5 } +; output 3 depends on inputs: { 3, 4, 5 } +; +target datalayout = "e-m:e-p:32:32-i1:32-i8:32-i16:32-i32:32-i64:64-f16:32-f32:32-f64:64-n8:16:32:64" +target triple = "dxil-ms-dx" + +%dx.types.Handle = type { i8* } +%dx.types.ResRet.f32 = type { float, float, float, float, i32 } +%"class.Texture2D >" = type { <4 x float>, %"class.Texture2D >::mips_type" } +%"class.Texture2D >::mips_type" = type { i32 } +%struct.SamplerState = type { i32 } + +define void @main() { + %1 = call %dx.types.Handle @dx.op.createHandle(i32 57, i8 0, i32 0, i32 0, i1 false) ; CreateHandle(resourceClass,rangeId,index,nonUniformIndex) + %2 = call %dx.types.Handle @dx.op.createHandle(i32 57, i8 3, i32 0, i32 0, i1 false) ; CreateHandle(resourceClass,rangeId,index,nonUniformIndex) + %3 = call float @dx.op.loadInput.f32(i32 4, i32 1, i32 0, i8 0, i32 undef) ; LoadInput(inputSigId,rowIndex,colIndex,gsVertexAxis) + %4 = call float @dx.op.loadInput.f32(i32 4, i32 1, i32 0, i8 1, i32 undef) ; LoadInput(inputSigId,rowIndex,colIndex,gsVertexAxis) + %5 = call float @dx.op.loadInput.f32(i32 4, i32 0, i32 0, i8 0, i32 undef) ; LoadInput(inputSigId,rowIndex,colIndex,gsVertexAxis) + %6 = call float @dx.op.loadInput.f32(i32 4, i32 0, i32 0, i8 1, i32 undef) ; LoadInput(inputSigId,rowIndex,colIndex,gsVertexAxis) + %7 = call float @dx.op.loadInput.f32(i32 4, i32 0, i32 0, i8 2, i32 undef) ; LoadInput(inputSigId,rowIndex,colIndex,gsVertexAxis) + %8 = call float @dx.op.loadInput.f32(i32 4, i32 0, i32 0, i8 3, i32 undef) ; LoadInput(inputSigId,rowIndex,colIndex,gsVertexAxis) + %9 = call %dx.types.ResRet.f32 @dx.op.sample.f32(i32 60, %dx.types.Handle %1, %dx.types.Handle %2, float %3, float %4, float undef, float undef, i32 0, i32 0, i32 undef, float undef) ; Sample(srv,sampler,coord0,coord1,coord2,coord3,offset0,offset1,offset2,clamp) + %10 = extractvalue %dx.types.ResRet.f32 %9, 0 + %11 = extractvalue %dx.types.ResRet.f32 %9, 1 + %12 = extractvalue %dx.types.ResRet.f32 %9, 2 + %13 = extractvalue %dx.types.ResRet.f32 %9, 3 + %14 = fmul fast float %10, %5 + %15 = fmul fast float %11, %6 + %16 = fmul fast float %12, %7 + %17 = fmul fast float %13, %8 + call void @dx.op.storeOutput.f32(i32 5, i32 0, i32 0, i8 0, float %14) ; StoreOutput(outputSigId,rowIndex,colIndex,value) + call void @dx.op.storeOutput.f32(i32 5, i32 0, i32 0, i8 1, float %15) ; StoreOutput(outputSigId,rowIndex,colIndex,value) + call void @dx.op.storeOutput.f32(i32 5, i32 0, i32 0, i8 2, float %16) ; StoreOutput(outputSigId,rowIndex,colIndex,value) + call void @dx.op.storeOutput.f32(i32 5, i32 0, i32 0, i8 3, float %17) ; StoreOutput(outputSigId,rowIndex,colIndex,value) + ret void +} + +; Function Attrs: nounwind readnone +declare float @dx.op.loadInput.f32(i32, i32, i32, i8, i32) #0 + +; Function Attrs: nounwind +declare void @dx.op.storeOutput.f32(i32, i32, i32, i8, float) #1 + +; Function Attrs: nounwind readonly +declare %dx.types.ResRet.f32 @dx.op.sample.f32(i32, %dx.types.Handle, %dx.types.Handle, float, float, float, float, i32, i32, i32, float) #2 + +; Function Attrs: nounwind readonly +declare %dx.types.Handle @dx.op.createHandle(i32, i8, i32, i32, i1) #2 + +attributes #0 = { nounwind readnone } +attributes #1 = { nounwind } +attributes #2 = { nounwind readonly } + +!llvm.ident = !{!0} +!dx.version = !{!1} +!dx.valver = !{!2} +!dx.shaderModel = !{!3} +!dx.resources = !{!4} +!dx.viewIdState = !{!10} +!dx.entryPoints = !{!11} + +!0 = !{!"dxc(private) 1.8.0.4662 (416fab6b5)"} +!1 = !{i32 1, i32 0} +!2 = !{i32 1, i32 8} +!3 = !{!"ps", i32 6, i32 0} +!4 = !{!5, null, null, !8} +!5 = !{!6} +!6 = !{i32 0, %"class.Texture2D >"* undef, !"", i32 2, i32 0, i32 1, i32 2, i32 0, !7} +!7 = !{i32 0, i32 9} +!8 = !{!9} +!9 = !{i32 0, %struct.SamplerState* undef, !"", i32 2, i32 0, i32 1, i32 0, null} +!10 = !{[8 x i32] [i32 6, i32 4, i32 1, i32 2, i32 4, i32 8, i32 15, i32 15]} +!11 = !{void ()* @main, !"main", !12, !4, null} +!12 = !{!13, !20, null} +!13 = !{!14, !17} +!14 = !{i32 0, !"TEXCOORD", i8 9, i8 0, !15, i8 2, i32 1, i8 4, i32 0, i8 0, !16} +!15 = !{i32 0} +!16 = !{i32 3, i32 15} +!17 = !{i32 1, !"TEXCOORD", i8 9, i8 0, !18, i8 2, i32 1, i8 2, i32 1, i8 0, !19} +!18 = !{i32 1} +!19 = !{i32 3, i32 3} +!20 = !{!21} +!21 = !{i32 0, !"SV_Target", i8 9, i8 16, !15, i8 0, i32 1, i8 4, i32 0, i8 0, !16} + +#endif + +static const unsigned char shader_frag_sm60_dxil[] = { + 0x44, 0x58, 0x42, 0x43, 0x36, 0xc2, 0xd4, 0xa8, 0xb2, 0x55, 0xbc, 0xb9, + 0x9f, 0x97, 0x7b, 0x77, 0x39, 0xee, 0x25, 0x8a, 0x01, 0x00, 0x00, 0x00, + 0x24, 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, 0x38, 0x08, 0x00, 0x00, 0x54, 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, 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, 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, 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, 0x06, 0x00, 0x00, + 0x60, 0x00, 0x00, 0x00, 0x96, 0x01, 0x00, 0x00, 0x44, 0x58, 0x49, 0x4c, + 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x40, 0x06, 0x00, 0x00, + 0x42, 0x43, 0xc0, 0xde, 0x21, 0x0c, 0x00, 0x00, 0x8d, 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, 0x0e, 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, 0x1e, 0x85, 0x50, 0x2c, 0x54, 0x4a, 0x62, 0x04, 0xa0, 0x08, + 0x0a, 0xa1, 0x40, 0xc8, 0xce, 0x00, 0x10, 0x9e, 0x01, 0xa0, 0x3c, 0x16, + 0x62, 0x10, 0x81, 0x40, 0x20, 0xcf, 0x03, 0x00, 0x79, 0x18, 0x00, 0x00, + 0x7b, 0x00, 0x00, 0x00, 0x1a, 0x03, 0x4c, 0x90, 0x46, 0x02, 0x13, 0xc4, + 0x31, 0x20, 0xc3, 0x1b, 0x43, 0x81, 0x93, 0x4b, 0xb3, 0x0b, 0xa3, 0x2b, + 0x4b, 0x01, 0x89, 0x71, 0xc1, 0x71, 0x81, 0x71, 0xa1, 0xb1, 0xb1, 0x91, + 0x01, 0x41, 0xa1, 0x89, 0xb1, 0x31, 0x0b, 0x13, 0xb3, 0x11, 0xab, 0x49, + 0xd9, 0x10, 0x04, 0x13, 0x04, 0xa2, 0x98, 0x20, 0x10, 0xc6, 0x06, 0x61, + 0x20, 0x36, 0x08, 0x04, 0x41, 0x01, 0x6e, 0x6e, 0x82, 0x40, 0x1c, 0x1b, + 0x86, 0x03, 0x21, 0x26, 0x08, 0xd6, 0xc4, 0xe1, 0x2b, 0xc6, 0x66, 0x82, + 0x40, 0x20, 0x13, 0x04, 0x22, 0xd9, 0x20, 0x10, 0xcd, 0x86, 0x84, 0x50, + 0x16, 0x86, 0x18, 0x18, 0xc2, 0xd9, 0x10, 0x3c, 0x13, 0x04, 0x8c, 0x22, + 0xf3, 0xf5, 0x15, 0x63, 0xf3, 0x35, 0x17, 0xd6, 0x06, 0xc7, 0x56, 0x26, + 0xb7, 0x01, 0x21, 0x22, 0x89, 0x21, 0x06, 0x02, 0xd8, 0x10, 0x4c, 0x1b, + 0x08, 0x08, 0x00, 0xa8, 0x09, 0x82, 0x00, 0x6c, 0x00, 0x36, 0x0c, 0xc4, + 0x75, 0x6d, 0x08, 0xb0, 0x0d, 0xc3, 0x60, 0x65, 0x13, 0x84, 0xac, 0xda, + 0x10, 0x6c, 0x24, 0xda, 0xc2, 0xd2, 0xdc, 0x88, 0x50, 0x15, 0x61, 0x0d, + 0x3d, 0x3d, 0x49, 0x11, 0x4d, 0x10, 0x0a, 0x67, 0x82, 0x50, 0x3c, 0x1b, + 0x02, 0x62, 0x82, 0x50, 0x40, 0x13, 0x84, 0x22, 0x9a, 0x20, 0x10, 0xca, + 0x04, 0x81, 0x58, 0x36, 0x08, 0x64, 0x50, 0x06, 0x1b, 0x16, 0xc2, 0xfb, + 0xc0, 0x20, 0x0c, 0xc4, 0x60, 0x18, 0x03, 0x02, 0x0c, 0xcc, 0x60, 0x43, + 0x30, 0x6c, 0x10, 0xc8, 0x80, 0x0c, 0x36, 0x2c, 0x83, 0xf7, 0x81, 0x01, + 0x1a, 0x88, 0xc1, 0x20, 0x06, 0x03, 0x18, 0xa4, 0xc1, 0x06, 0xe1, 0x0c, + 0xd4, 0x80, 0xc9, 0x94, 0xd5, 0x17, 0x55, 0x98, 0xdc, 0x59, 0x19, 0xdd, + 0x04, 0xa1, 0x90, 0x36, 0x2c, 0x04, 0x1b, 0x7c, 0x6d, 0x10, 0x06, 0x60, + 0x30, 0x8c, 0x01, 0x01, 0x06, 0x66, 0xb0, 0x21, 0x70, 0x83, 0x0d, 0xc3, + 0x1a, 0xbc, 0x01, 0xb0, 0xa1, 0xb0, 0x3a, 0x38, 0xa8, 0x00, 0x1a, 0x66, + 0x6c, 0x6f, 0x61, 0x74, 0x73, 0x13, 0x04, 0x82, 0x61, 0x91, 0xe6, 0x36, + 0x47, 0x37, 0x37, 0x41, 0x20, 0x1a, 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, 0xe4, 0x60, 0x0e, 0xe8, 0xa0, + 0x0e, 0xec, 0x00, 0xb9, 0x83, 0x39, 0xc0, 0x83, 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, 0x80, 0xaa, 0x44, + 0x86, 0xe7, 0x42, 0x97, 0x07, 0x57, 0x16, 0xe4, 0xe6, 0xf6, 0x46, 0x17, + 0x46, 0x97, 0xf6, 0xe6, 0x36, 0x37, 0x25, 0xc8, 0xea, 0x90, 0xe1, 0xb9, + 0xd8, 0xa5, 0x95, 0xdd, 0x25, 0x91, 0x4d, 0xd1, 0x85, 0xd1, 0x95, 0x4d, + 0x09, 0xb6, 0x3a, 0x64, 0x78, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, + 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x53, 0x02, 0x38, 0xe8, 0x42, 0x86, 0xe7, + 0x32, 0xf6, 0x56, 0xe7, 0x46, 0x57, 0x26, 0x37, 0x37, 0x25, 0xc0, 0x03, + 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, 0xab, 0x99, 0x02, 0x6f, 0x30, 0x68, 0xb3, 0x31, + 0x43, 0x41, 0xba, 0x15, 0xea, 0xf6, 0x26, 0xa8, 0x44, 0x58, 0x49, 0x4c, + 0xc8, 0x06, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0xb2, 0x01, 0x00, 0x00, + 0x44, 0x58, 0x49, 0x4c, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0xb0, 0x06, 0x00, 0x00, 0x42, 0x43, 0xc0, 0xde, 0x21, 0x0c, 0x00, 0x00, + 0xa9, 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, 0xe5, 0x41, 0xa5, 0x24, 0x46, + 0x00, 0x8a, 0xa0, 0x10, 0x0a, 0x84, 0xec, 0x0c, 0x00, 0xe1, 0x19, 0x00, + 0xca, 0x63, 0x21, 0x06, 0x11, 0x08, 0x04, 0xf2, 0x3c, 0x00, 0x00, 0x00, + 0x79, 0x18, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x1a, 0x03, 0x4c, 0x90, + 0x46, 0x02, 0x13, 0xc4, 0x31, 0x20, 0xc3, 0x1b, 0x43, 0x81, 0x93, 0x4b, + 0xb3, 0x0b, 0xa3, 0x2b, 0x4b, 0x01, 0x89, 0x71, 0xc1, 0x71, 0x81, 0x71, + 0xa1, 0xb1, 0xb1, 0x91, 0x01, 0x41, 0xa1, 0x89, 0xb1, 0x31, 0x0b, 0x13, + 0xb3, 0x11, 0xab, 0x49, 0xd9, 0x10, 0x04, 0x13, 0x04, 0xa2, 0x98, 0x20, + 0x10, 0xc6, 0x06, 0x61, 0x20, 0x26, 0x08, 0xc4, 0xb1, 0x41, 0x18, 0x0c, + 0x0a, 0x70, 0x73, 0x13, 0x04, 0x02, 0xd9, 0x30, 0x20, 0x09, 0x31, 0x41, + 0xb0, 0x24, 0x02, 0x13, 0x04, 0x22, 0x99, 0x20, 0x10, 0xca, 0x06, 0x81, + 0x70, 0x36, 0x24, 0xc4, 0xc2, 0x34, 0xc4, 0xd0, 0x10, 0xcf, 0x86, 0x00, + 0x9a, 0x20, 0x60, 0xd3, 0x06, 0x84, 0x90, 0x98, 0x86, 0x18, 0x08, 0x60, + 0x43, 0x30, 0x6d, 0x20, 0x22, 0x00, 0xa0, 0x26, 0x08, 0x19, 0xb5, 0x21, + 0xb0, 0x26, 0x08, 0x02, 0x40, 0xa2, 0x2d, 0x2c, 0xcd, 0x8d, 0x08, 0x55, + 0x11, 0xd6, 0xd0, 0xd3, 0x93, 0x14, 0xd1, 0x04, 0xa1, 0x68, 0x26, 0x08, + 0x85, 0xb3, 0x21, 0x20, 0x26, 0x08, 0xc5, 0x33, 0x41, 0x28, 0xa0, 0x09, + 0x02, 0xb1, 0x4c, 0x10, 0x08, 0x66, 0x83, 0x00, 0x06, 0x61, 0xb0, 0x61, + 0x21, 0xb4, 0x8d, 0xeb, 0xbc, 0xe1, 0x23, 0x38, 0x31, 0xd8, 0x10, 0x0c, + 0x1b, 0x04, 0x30, 0x00, 0x83, 0x0d, 0xcb, 0xa0, 0x6d, 0x1c, 0x19, 0x78, + 0x83, 0x37, 0x70, 0x65, 0xb0, 0x41, 0x18, 0x03, 0x33, 0x60, 0x32, 0x65, + 0xf5, 0x45, 0x15, 0x26, 0x77, 0x56, 0x46, 0x37, 0x41, 0x28, 0xa2, 0x0d, + 0x0b, 0x81, 0x06, 0x5b, 0x1a, 0x74, 0xdc, 0xf0, 0x11, 0x9c, 0x18, 0x6c, + 0x08, 0xd4, 0x60, 0xc3, 0x70, 0x06, 0x6b, 0x00, 0x6c, 0x28, 0xb0, 0x8c, + 0x0d, 0x2a, 0xa0, 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, 0x8c, 0x3a, 0x64, 0x78, 0x2e, 0x73, + 0x68, 0x61, 0x64, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x82, + 0xa4, 0x0c, 0x19, 0x9e, 0x8b, 0x5c, 0xd9, 0xdc, 0x5b, 0x9d, 0xdc, 0x58, + 0xd9, 0xdc, 0x94, 0x80, 0xaa, 0x43, 0x86, 0xe7, 0x62, 0x97, 0x56, 0x76, + 0x97, 0x44, 0x36, 0x45, 0x17, 0x46, 0x57, 0x36, 0x25, 0xb0, 0xea, 0x90, + 0xe1, 0xb9, 0x94, 0xb9, 0xd1, 0xc9, 0xe5, 0x41, 0xbd, 0xa5, 0xb9, 0xd1, + 0xcd, 0x4d, 0x09, 0xd8, 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, 0x61, 0x20, 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00, + 0x13, 0x04, 0x41, 0x2c, 0x10, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, + 0xf4, 0x46, 0x00, 0x88, 0xcc, 0x00, 0x14, 0x42, 0x29, 0x94, 0x5c, 0xe1, + 0x51, 0x29, 0x83, 0x12, 0xa0, 0x31, 0x03, 0x00, 0x23, 0x06, 0x09, 0x00, + 0x82, 0x60, 0x00, 0x69, 0x05, 0x84, 0x61, 0xc9, 0x88, 0x41, 0x02, 0x80, + 0x20, 0x18, 0x40, 0x9b, 0x41, 0x64, 0x99, 0x32, 0x62, 0x90, 0x00, 0x20, + 0x08, 0x06, 0xc6, 0x97, 0x6c, 0x9a, 0xa4, 0x8c, 0x18, 0x24, 0x00, 0x08, + 0x82, 0x81, 0x01, 0x06, 0x0a, 0xb7, 0x15, 0xcb, 0x88, 0x41, 0x02, 0x80, + 0x20, 0x18, 0x18, 0x61, 0xb0, 0x70, 0x1c, 0xc5, 0x8c, 0x18, 0x24, 0x00, + 0x08, 0x82, 0x81, 0x21, 0x06, 0x4c, 0xd7, 0x1d, 0xcd, 0x88, 0x41, 0x02, + 0x80, 0x20, 0x18, 0x18, 0x63, 0xd0, 0x78, 0x5e, 0xe5, 0x8c, 0x18, 0x24, + 0x00, 0x08, 0x82, 0x81, 0x41, 0x06, 0xce, 0xf7, 0x29, 0xcf, 0x88, 0xc1, + 0x03, 0x80, 0x20, 0x18, 0x34, 0x63, 0xc0, 0x20, 0x87, 0x51, 0x24, 0x09, + 0x18, 0x80, 0x01, 0x94, 0x8c, 0x26, 0x04, 0xc0, 0x68, 0x82, 0x10, 0x8c, + 0x26, 0x0c, 0xc2, 0x68, 0x02, 0x31, 0x18, 0x91, 0xc8, 0xc7, 0x88, 0x44, + 0x3e, 0x46, 0x24, 0xf2, 0x31, 0x22, 0x91, 0xcf, 0x88, 0x41, 0x02, 0x80, + 0x20, 0x18, 0x20, 0x6d, 0x70, 0xa5, 0x41, 0x1a, 0x84, 0x01, 0x31, 0x62, + 0x90, 0x00, 0x20, 0x08, 0x06, 0x48, 0x1b, 0x5c, 0x69, 0x90, 0x06, 0xd3, + 0x30, 0x62, 0x90, 0x00, 0x20, 0x08, 0x06, 0x48, 0x1b, 0x5c, 0x69, 0x90, + 0x06, 0x60, 0x20, 0x8c, 0x18, 0x24, 0x00, 0x08, 0x82, 0x01, 0xd2, 0x06, + 0x57, 0x1a, 0xa4, 0x01, 0x15, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; diff --git a/examples/testgputext/shaders/shader.frag.sm60.hlsl b/examples/testgputext/shaders/shader.frag.sm60.hlsl new file mode 100644 index 00000000..bdf6c370 --- /dev/null +++ b/examples/testgputext/shaders/shader.frag.sm60.hlsl @@ -0,0 +1,32 @@ +Texture2D _16 : register(t0, space2); +SamplerState __16_sampler : register(s0, space2); + +static float4 _9; +static float4 _11; +static float2 _20; + +struct SPIRV_Cross_Input +{ + float4 _11 : TEXCOORD0; + float2 _20 : TEXCOORD1; +}; + +struct SPIRV_Cross_Output +{ + float4 _9 : SV_Target0; +}; + +void frag_main() +{ + _9 = _11 * _16.Sample(__16_sampler, _20); +} + +SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) +{ + _11 = stage_input._11; + _20 = stage_input._20; + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output._9 = _9; + return stage_output; +} diff --git a/examples/testgputext/shaders/shader.frag.spv.h b/examples/testgputext/shaders/shader.frag.spv.h new file mode 100644 index 00000000..0d069a84 --- /dev/null +++ b/examples/testgputext/shaders/shader.frag.spv.h @@ -0,0 +1,50 @@ +static const unsigned char shader_frag_spv[] = { + 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, + 0x18, 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, + 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, + 0x09, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x47, 0x00, 0x04, 0x00, 0x09, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, + 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x47, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x3b, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x0a, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, + 0x0a, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x19, 0x00, 0x09, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x1b, 0x00, 0x03, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, + 0x20, 0x00, 0x04, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0e, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x0f, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, + 0x12, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x20, 0x00, 0x04, 0x00, 0x13, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x12, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x13, 0x00, 0x00, 0x00, + 0x14, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, + 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, + 0x0b, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, + 0x11, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, + 0x12, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x57, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, + 0x11, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, + 0x16, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x09, 0x00, 0x00, 0x00, + 0x17, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00 +}; +static const unsigned int shader_frag_spv_len = 564; diff --git a/examples/testgputext/shaders/shader.vert b/examples/testgputext/shaders/shader.vert new file mode 100644 index 00000000..cefaebac --- /dev/null +++ b/examples/testgputext/shaders/shader.vert @@ -0,0 +1,19 @@ +#version 450 + +layout (location = 0) in vec3 vpos; +layout (location = 1) in vec4 vcolour; +layout (location = 2) in vec2 tex_coord; + +layout (location = 0) out vec4 colour; +layout (location = 1) out vec2 coord; + +layout (set = 1, binding = 0) uniform uniform_block { + mat4 proj_view; + mat4 model; +}; + +void main() { + colour = vcolour; + coord = tex_coord; + gl_Position = proj_view * model * vec4(vpos, 1.0f); +} diff --git a/examples/testgputext/shaders/shader.vert.metal b/examples/testgputext/shaders/shader.vert.metal new file mode 100644 index 00000000..4e8c8b7d --- /dev/null +++ b/examples/testgputext/shaders/shader.vert.metal @@ -0,0 +1,34 @@ +#include +#include + +using namespace metal; + +struct _28 +{ + float4x4 _m0; + float4x4 _m1; +}; + +struct main0_out +{ + float4 m_9 [[user(locn0)]]; + float2 m_15 [[user(locn1)]]; + float4 gl_Position [[position]]; +}; + +struct main0_in +{ + float3 m_40 [[attribute(0)]]; + float4 m_11 [[attribute(1)]]; + float2 m_17 [[attribute(2)]]; +}; + +vertex main0_out main0(main0_in in [[stage_in]], constant _28& _30 [[buffer(0)]]) +{ + main0_out out = {}; + out.m_9 = in.m_11; + out.m_15 = in.m_17; + out.gl_Position = (_30._m0 * _30._m1) * float4(in.m_40, 1.0); + return out; +} + diff --git a/examples/testgputext/shaders/shader.vert.metal.h b/examples/testgputext/shaders/shader.vert.metal.h new file mode 100644 index 00000000..2d7767be --- /dev/null +++ b/examples/testgputext/shaders/shader.vert.metal.h @@ -0,0 +1,55 @@ +static const unsigned char shader_vert_metal[] = { + 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, 0x5f, 0x32, 0x38, 0x0a, 0x7b, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x78, + 0x34, 0x20, 0x5f, 0x6d, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, + 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x78, 0x34, 0x20, 0x5f, 0x6d, 0x31, 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, 0x6d, + 0x5f, 0x39, 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, 0x6d, 0x5f, 0x31, 0x35, 0x20, + 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, 0x31, + 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, + 0x61, 0x74, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 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, 0x33, 0x20, 0x6d, 0x5f, 0x34, 0x30, 0x20, 0x5b, 0x5b, 0x61, 0x74, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x30, 0x29, 0x5d, 0x5d, + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, + 0x20, 0x6d, 0x5f, 0x31, 0x31, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, + 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, + 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x6d, + 0x5f, 0x31, 0x37, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 0x28, 0x32, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, + 0x0a, 0x0a, 0x76, 0x65, 0x72, 0x74, 0x65, 0x78, 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, + 0x5f, 0x32, 0x38, 0x26, 0x20, 0x5f, 0x33, 0x30, 0x20, 0x5b, 0x5b, 0x62, + 0x75, 0x66, 0x66, 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, 0x6f, 0x75, 0x74, 0x2e, 0x6d, 0x5f, + 0x39, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x2e, 0x6d, 0x5f, 0x31, 0x31, 0x3b, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x6d, 0x5f, 0x31, + 0x35, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x2e, 0x6d, 0x5f, 0x31, 0x37, 0x3b, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x67, 0x6c, 0x5f, + 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x28, + 0x5f, 0x33, 0x30, 0x2e, 0x5f, 0x6d, 0x30, 0x20, 0x2a, 0x20, 0x5f, 0x33, + 0x30, 0x2e, 0x5f, 0x6d, 0x31, 0x29, 0x20, 0x2a, 0x20, 0x66, 0x6c, 0x6f, + 0x61, 0x74, 0x34, 0x28, 0x69, 0x6e, 0x2e, 0x6d, 0x5f, 0x34, 0x30, 0x2c, + 0x20, 0x31, 0x2e, 0x30, 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 shader_vert_metal_len = 614; diff --git a/examples/testgputext/shaders/shader.vert.sm50.dxbc.h b/examples/testgputext/shaders/shader.vert.sm50.dxbc.h new file mode 100644 index 00000000..df9117d7 --- /dev/null +++ b/examples/testgputext/shaders/shader.vert.sm50.dxbc.h @@ -0,0 +1,1320 @@ +static const signed char shader_vert_sm50_dxbc[] = +{ + 68, 88, 66, 67, -30, 43, + -92, 90,-116, -71, 82,-105, + 50, -27, -26, -2, 73, 45, + 20, -4, 1, 0, 0, 0, + -36, 30, 0, 0, 4, 0, + 0, 0, 48, 0, 0, 0, + -84, 0, 0, 0, 40, 1, + 0, 0,-120, 2, 0, 0, + 73, 83, 71, 78, 116, 0, + 0, 0, 3, 0, 0, 0, + 8, 0, 0, 0, 80, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 7, 7, 0, 0, 92, 0, + 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 1, 0, 0, 0, + 15, 15, 0, 0, 104, 0, + 0, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 2, 0, 0, 0, + 3, 3, 0, 0, 84, 69, + 88, 67, 79, 79, 82, 68, + 0, -85, -85, -85, 84, 69, + 88, 67, 79, 79, 82, 68, + 0, -85, -85, -85, 84, 69, + 88, 67, 79, 79, 82, 68, + 0, -85, -85, -85, 79, 83, + 71, 78, 116, 0, 0, 0, + 3, 0, 0, 0, 8, 0, + 0, 0, 80, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 15, 0, + 0, 0, 92, 0, 0, 0, + 1, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 1, 0, 0, 0, 3, 12, + 0, 0, 104, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 3, 0, 0, 0, + 2, 0, 0, 0, 15, 0, + 0, 0, 84, 69, 88, 67, + 79, 79, 82, 68, 0, -85, + -85, -85, 84, 69, 88, 67, + 79, 79, 82, 68, 0, -85, + -85, -85, 83, 86, 95, 80, + 111, 115, 105, 116, 105, 111, + 110, 0, 82, 68, 69, 70, + 88, 1, 0, 0, 1, 0, + 0, 0, 100, 0, 0, 0, + 1, 0, 0, 0, 60, 0, + 0, 0, 0, 5, -2, -1, + 0, 0, 0, 0, 68, 1, + 0, 0, 82, 68, 49, 49, + 60, 0, 0, 0, 24, 0, + 0, 0, 32, 0, 0, 0, + 40, 0, 0, 0, 36, 0, + 0, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 92, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 1, 0, 0, 0, + 95, 50, 56, 95, 51, 48, + 0, -85, 124, 0, 0, 0, + 2, 0, 0, 0,-124, 0, + 0, 0,-128, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 95, 50, 56, 95, + 51, 48, 0, -85, -44, 0, + 0, 0, 0, 0, 0, 0, + 64, 0, 0, 0, 2, 0, + 0, 0, -24, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 12, 1, 0, 0, + 64, 0, 0, 0, 64, 0, + 0, 0, 2, 0, 0, 0, + 32, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 95, 51, 48, 95, 109, 48, + 0, -85, 102, 108, 111, 97, + 116, 52, 120, 52, 0, -85, + -85, -85, 2, 0, 3, 0, + 4, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -36, 0, + 0, 0, 95, 51, 48, 95, + 109, 49, 0, -85, 102, 108, + 111, 97, 116, 52, 120, 52, + 0, -85, -85, -85, 2, 0, + 3, 0, 4, 0, 4, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 20, 1, 0, 0, 118, 107, + 100, 51, 100, 45, 115, 104, + 97, 100, 101, 114, 32, 49, + 46, 49, 48, 0, -85, -85, + 83, 72, 68, 82, 76, 28, + 0, 0, 80, 0, 1, 0, + 19, 7, 0, 0, 89, 0, + 0, 4, 70,-114, 32, 0, + 0, 0, 0, 0, 8, 0, + 0, 0, 95, 0, 0, 3, + 114, 16, 16, 0, 0, 0, + 0, 0, 95, 0, 0, 3, + -14, 16, 16, 0, 1, 0, + 0, 0, 95, 0, 0, 3, + 50, 16, 16, 0, 2, 0, + 0, 0, 101, 0, 0, 3, + -14, 32, 16, 0, 0, 0, + 0, 0, 101, 0, 0, 3, + 50, 32, 16, 0, 1, 0, + 0, 0, 103, 0, 0, 4, + -14, 32, 16, 0, 2, 0, + 0, 0, 1, 0, 0, 0, + 104, 0, 0, 2, 14, 0, + 0, 0, 54, 0, 0, 5, + 50, 0, 16, 0, 0, 0, + 0, 0, 70, 16, 16, 0, + 2, 0, 0, 0, 54, 0, + 0, 5, -14, 0, 16, 0, + 1, 0, 0, 0, 70, 30, + 16, 0, 1, 0, 0, 0, + 54, 0, 0, 5, 114, 0, + 16, 0, 2, 0, 0, 0, + 70, 18, 16, 0, 0, 0, + 0, 0, 54, 0, 0, 6, + -14, 0, 16, 0, 3, 0, + 0, 0, 70,-114, 32, 0, + 0, 0, 0, 0, 4, 0, + 0, 0, 54, 0, 0, 6, + -14, 0, 16, 0, 4, 0, + 0, 0, 70,-114, 32, 0, + 0, 0, 0, 0, 5, 0, + 0, 0, 54, 0, 0, 6, + -14, 0, 16, 0, 5, 0, + 0, 0, 70,-114, 32, 0, + 0, 0, 0, 0, 6, 0, + 0, 0, 54, 0, 0, 6, + -14, 0, 16, 0, 6, 0, + 0, 0, 70,-114, 32, 0, + 0, 0, 0, 0, 7, 0, + 0, 0, 54, 0, 0, 6, + -14, 0, 16, 0, 7, 0, + 0, 0, 70,-114, 32, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 54, 0, 0, 6, + -14, 0, 16, 0, 8, 0, + 0, 0, 70,-114, 32, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 54, 0, 0, 6, + -14, 0, 16, 0, 9, 0, + 0, 0, 70,-114, 32, 0, + 0, 0, 0, 0, 2, 0, + 0, 0, 54, 0, 0, 6, + -14, 0, 16, 0, 10, 0, + 0, 0, 70,-114, 32, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 54, 0, 0, 5, + 66, 0, 16, 0, 0, 0, + 0, 0, 6, 0, 16, 0, + 3, 0, 0, 0, 54, 0, + 0, 5,-126, 0, 16, 0, + 0, 0, 0, 0, 6, 0, + 16, 0, 7, 0, 0, 0, + 56, 0, 0, 7, 66, 0, + 16, 0, 0, 0, 0, 0, + -90, 10, 16, 0, 0, 0, + 0, 0, -10, 15, 16, 0, + 0, 0, 0, 0, 54, 0, + 0, 5,-126, 0, 16, 0, + 0, 0, 0, 0, 6, 4, + 16, 0, 3, 0, 0, 0, + 54, 0, 0, 5,-126, 0, + 16, 0, 2, 0, 0, 0, + 6, 0, 16, 0, 8, 0, + 0, 0, 56, 0, 0, 7, +-126, 0, 16, 0, 0, 0, + 0, 0, -10, 15, 16, 0, + 0, 0, 0, 0, -10, 15, + 16, 0, 2, 0, 0, 0, + 0, 0, 0, 7, 66, 0, + 16, 0, 0, 0, 0, 0, + -90, 10, 16, 0, 0, 0, + 0, 0, -10, 15, 16, 0, + 0, 0, 0, 0, 54, 0, + 0, 5,-126, 0, 16, 0, + 0, 0, 0, 0, 6, 8, + 16, 0, 3, 0, 0, 0, + 54, 0, 0, 5,-126, 0, + 16, 0, 2, 0, 0, 0, + 6, 0, 16, 0, 9, 0, + 0, 0, 56, 0, 0, 7, +-126, 0, 16, 0, 0, 0, + 0, 0, -10, 15, 16, 0, + 0, 0, 0, 0, -10, 15, + 16, 0, 2, 0, 0, 0, + 0, 0, 0, 7, 66, 0, + 16, 0, 0, 0, 0, 0, + -90, 10, 16, 0, 0, 0, + 0, 0, -10, 15, 16, 0, + 0, 0, 0, 0, 54, 0, + 0, 5,-126, 0, 16, 0, + 0, 0, 0, 0, 6, 12, + 16, 0, 3, 0, 0, 0, + 54, 0, 0, 5,-126, 0, + 16, 0, 2, 0, 0, 0, + 6, 0, 16, 0, 10, 0, + 0, 0, 56, 0, 0, 7, +-126, 0, 16, 0, 0, 0, + 0, 0, -10, 15, 16, 0, + 0, 0, 0, 0, -10, 15, + 16, 0, 2, 0, 0, 0, + 0, 0, 0, 7, 66, 0, + 16, 0, 0, 0, 0, 0, + -90, 10, 16, 0, 0, 0, + 0, 0, -10, 15, 16, 0, + 0, 0, 0, 0, 54, 0, + 0, 5,-126, 0, 16, 0, + 0, 0, 0, 0, 6, 0, + 16, 0, 4, 0, 0, 0, + 54, 0, 0, 5,-126, 0, + 16, 0, 2, 0, 0, 0, + 6, 0, 16, 0, 7, 0, + 0, 0, 56, 0, 0, 7, +-126, 0, 16, 0, 0, 0, + 0, 0, -10, 15, 16, 0, + 0, 0, 0, 0, -10, 15, + 16, 0, 2, 0, 0, 0, + 54, 0, 0, 5,-126, 0, + 16, 0, 2, 0, 0, 0, + 6, 4, 16, 0, 4, 0, + 0, 0, 54, 0, 0, 5, + 18, 0, 16, 0, 11, 0, + 0, 0, 6, 0, 16, 0, + 8, 0, 0, 0, 56, 0, + 0, 7,-126, 0, 16, 0, + 2, 0, 0, 0, -10, 15, + 16, 0, 2, 0, 0, 0, + 6, 0, 16, 0, 11, 0, + 0, 0, 0, 0, 0, 7, +-126, 0, 16, 0, 0, 0, + 0, 0, -10, 15, 16, 0, + 0, 0, 0, 0, -10, 15, + 16, 0, 2, 0, 0, 0, + 54, 0, 0, 5,-126, 0, + 16, 0, 2, 0, 0, 0, + 6, 8, 16, 0, 4, 0, + 0, 0, 54, 0, 0, 5, + 18, 0, 16, 0, 11, 0, + 0, 0, 6, 0, 16, 0, + 9, 0, 0, 0, 56, 0, + 0, 7,-126, 0, 16, 0, + 2, 0, 0, 0, -10, 15, + 16, 0, 2, 0, 0, 0, + 6, 0, 16, 0, 11, 0, + 0, 0, 0, 0, 0, 7, +-126, 0, 16, 0, 0, 0, + 0, 0, -10, 15, 16, 0, + 0, 0, 0, 0, -10, 15, + 16, 0, 2, 0, 0, 0, + 54, 0, 0, 5,-126, 0, + 16, 0, 2, 0, 0, 0, + 6, 12, 16, 0, 4, 0, + 0, 0, 54, 0, 0, 5, + 18, 0, 16, 0, 11, 0, + 0, 0, 6, 0, 16, 0, + 10, 0, 0, 0, 56, 0, + 0, 7,-126, 0, 16, 0, + 2, 0, 0, 0, -10, 15, + 16, 0, 2, 0, 0, 0, + 6, 0, 16, 0, 11, 0, + 0, 0, 0, 0, 0, 7, +-126, 0, 16, 0, 0, 0, + 0, 0, -10, 15, 16, 0, + 0, 0, 0, 0, -10, 15, + 16, 0, 2, 0, 0, 0, + 54, 0, 0, 5,-126, 0, + 16, 0, 2, 0, 0, 0, + 6, 0, 16, 0, 5, 0, + 0, 0, 54, 0, 0, 5, + 18, 0, 16, 0, 11, 0, + 0, 0, 6, 0, 16, 0, + 7, 0, 0, 0, 56, 0, + 0, 7,-126, 0, 16, 0, + 2, 0, 0, 0, -10, 15, + 16, 0, 2, 0, 0, 0, + 6, 0, 16, 0, 11, 0, + 0, 0, 54, 0, 0, 5, + 18, 0, 16, 0, 11, 0, + 0, 0, 22, 0, 16, 0, + 5, 0, 0, 0, 54, 0, + 0, 5, 34, 0, 16, 0, + 11, 0, 0, 0, 6, 0, + 16, 0, 8, 0, 0, 0, + 56, 0, 0, 7, 18, 0, + 16, 0, 11, 0, 0, 0, + 6, 0, 16, 0, 11, 0, + 0, 0, 86, 5, 16, 0, + 11, 0, 0, 0, 0, 0, + 0, 7,-126, 0, 16, 0, + 2, 0, 0, 0, -10, 15, + 16, 0, 2, 0, 0, 0, + 6, 0, 16, 0, 11, 0, + 0, 0, 54, 0, 0, 5, + 18, 0, 16, 0, 11, 0, + 0, 0, 38, 0, 16, 0, + 5, 0, 0, 0, 54, 0, + 0, 5, 34, 0, 16, 0, + 11, 0, 0, 0, 6, 0, + 16, 0, 9, 0, 0, 0, + 56, 0, 0, 7, 18, 0, + 16, 0, 11, 0, 0, 0, + 6, 0, 16, 0, 11, 0, + 0, 0, 86, 5, 16, 0, + 11, 0, 0, 0, 0, 0, + 0, 7,-126, 0, 16, 0, + 2, 0, 0, 0, -10, 15, + 16, 0, 2, 0, 0, 0, + 6, 0, 16, 0, 11, 0, + 0, 0, 54, 0, 0, 5, + 18, 0, 16, 0, 11, 0, + 0, 0, 54, 0, 16, 0, + 5, 0, 0, 0, 54, 0, + 0, 5, 34, 0, 16, 0, + 11, 0, 0, 0, 6, 0, + 16, 0, 10, 0, 0, 0, + 56, 0, 0, 7, 18, 0, + 16, 0, 11, 0, 0, 0, + 6, 0, 16, 0, 11, 0, + 0, 0, 86, 5, 16, 0, + 11, 0, 0, 0, 0, 0, + 0, 7,-126, 0, 16, 0, + 2, 0, 0, 0, -10, 15, + 16, 0, 2, 0, 0, 0, + 6, 0, 16, 0, 11, 0, + 0, 0, 54, 0, 0, 5, + 18, 0, 16, 0, 11, 0, + 0, 0, 6, 0, 16, 0, + 6, 0, 0, 0, 54, 0, + 0, 5, 34, 0, 16, 0, + 11, 0, 0, 0, 6, 0, + 16, 0, 7, 0, 0, 0, + 56, 0, 0, 7, 18, 0, + 16, 0, 11, 0, 0, 0, + 6, 0, 16, 0, 11, 0, + 0, 0, 86, 5, 16, 0, + 11, 0, 0, 0, 54, 0, + 0, 5, 34, 0, 16, 0, + 11, 0, 0, 0, 70, 0, + 16, 0, 6, 0, 0, 0, + 54, 0, 0, 5, 66, 0, + 16, 0, 11, 0, 0, 0, + 6, 0, 16, 0, 8, 0, + 0, 0, 56, 0, 0, 7, + 34, 0, 16, 0, 11, 0, + 0, 0, 86, 5, 16, 0, + 11, 0, 0, 0, -90, 10, + 16, 0, 11, 0, 0, 0, + 0, 0, 0, 7, 18, 0, + 16, 0, 11, 0, 0, 0, + 6, 0, 16, 0, 11, 0, + 0, 0, 86, 5, 16, 0, + 11, 0, 0, 0, 54, 0, + 0, 5, 34, 0, 16, 0, + 11, 0, 0, 0,-122, 0, + 16, 0, 6, 0, 0, 0, + 54, 0, 0, 5, 66, 0, + 16, 0, 11, 0, 0, 0, + 6, 0, 16, 0, 9, 0, + 0, 0, 56, 0, 0, 7, + 34, 0, 16, 0, 11, 0, + 0, 0, 86, 5, 16, 0, + 11, 0, 0, 0, -90, 10, + 16, 0, 11, 0, 0, 0, + 0, 0, 0, 7, 18, 0, + 16, 0, 11, 0, 0, 0, + 6, 0, 16, 0, 11, 0, + 0, 0, 86, 5, 16, 0, + 11, 0, 0, 0, 54, 0, + 0, 5, 34, 0, 16, 0, + 11, 0, 0, 0, -58, 0, + 16, 0, 6, 0, 0, 0, + 54, 0, 0, 5, 66, 0, + 16, 0, 11, 0, 0, 0, + 6, 0, 16, 0, 10, 0, + 0, 0, 56, 0, 0, 7, + 34, 0, 16, 0, 11, 0, + 0, 0, 86, 5, 16, 0, + 11, 0, 0, 0, -90, 10, + 16, 0, 11, 0, 0, 0, + 0, 0, 0, 7, 18, 0, + 16, 0, 11, 0, 0, 0, + 6, 0, 16, 0, 11, 0, + 0, 0, 86, 5, 16, 0, + 11, 0, 0, 0, 54, 0, + 0, 5, 34, 0, 16, 0, + 11, 0, 0, 0, 6, 0, + 16, 0, 3, 0, 0, 0, + 54, 0, 0, 5, 66, 0, + 16, 0, 11, 0, 0, 0, + 6, 1, 16, 0, 7, 0, + 0, 0, 56, 0, 0, 7, + 34, 0, 16, 0, 11, 0, + 0, 0, 86, 5, 16, 0, + 11, 0, 0, 0, -90, 10, + 16, 0, 11, 0, 0, 0, + 54, 0, 0, 5, 66, 0, + 16, 0, 11, 0, 0, 0, + 6, 1, 16, 0, 3, 0, + 0, 0, 54, 0, 0, 5, +-126, 0, 16, 0, 11, 0, + 0, 0, 6, 4, 16, 0, + 8, 0, 0, 0, 56, 0, + 0, 7, 66, 0, 16, 0, + 11, 0, 0, 0, -90, 10, + 16, 0, 11, 0, 0, 0, + -10, 15, 16, 0, 11, 0, + 0, 0, 0, 0, 0, 7, + 34, 0, 16, 0, 11, 0, + 0, 0, 86, 5, 16, 0, + 11, 0, 0, 0, -90, 10, + 16, 0, 11, 0, 0, 0, + 54, 0, 0, 5, 66, 0, + 16, 0, 11, 0, 0, 0, + 6, 2, 16, 0, 3, 0, + 0, 0, 54, 0, 0, 5, +-126, 0, 16, 0, 11, 0, + 0, 0, 6, 4, 16, 0, + 9, 0, 0, 0, 56, 0, + 0, 7, 66, 0, 16, 0, + 11, 0, 0, 0, -90, 10, + 16, 0, 11, 0, 0, 0, + -10, 15, 16, 0, 11, 0, + 0, 0, 0, 0, 0, 7, + 34, 0, 16, 0, 11, 0, + 0, 0, 86, 5, 16, 0, + 11, 0, 0, 0, -90, 10, + 16, 0, 11, 0, 0, 0, + 54, 0, 0, 5, 66, 0, + 16, 0, 11, 0, 0, 0, + 6, 3, 16, 0, 3, 0, + 0, 0, 54, 0, 0, 5, +-126, 0, 16, 0, 11, 0, + 0, 0, 6, 4, 16, 0, + 10, 0, 0, 0, 56, 0, + 0, 7, 66, 0, 16, 0, + 11, 0, 0, 0, -90, 10, + 16, 0, 11, 0, 0, 0, + -10, 15, 16, 0, 11, 0, + 0, 0, 0, 0, 0, 7, + 34, 0, 16, 0, 11, 0, + 0, 0, 86, 5, 16, 0, + 11, 0, 0, 0, -90, 10, + 16, 0, 11, 0, 0, 0, + 54, 0, 0, 5, 66, 0, + 16, 0, 11, 0, 0, 0, + 6, 0, 16, 0, 4, 0, + 0, 0, 54, 0, 0, 5, +-126, 0, 16, 0, 11, 0, + 0, 0, 6, 4, 16, 0, + 7, 0, 0, 0, 56, 0, + 0, 7, 66, 0, 16, 0, + 11, 0, 0, 0, -90, 10, + 16, 0, 11, 0, 0, 0, + -10, 15, 16, 0, 11, 0, + 0, 0, 54, 0, 0, 5, +-126, 0, 16, 0, 11, 0, + 0, 0, 6, 4, 16, 0, + 4, 0, 0, 0, 54, 0, + 0, 5, 18, 0, 16, 0, + 12, 0, 0, 0, 22, 0, + 16, 0, 8, 0, 0, 0, + 56, 0, 0, 7,-126, 0, + 16, 0, 11, 0, 0, 0, + -10, 15, 16, 0, 11, 0, + 0, 0, 6, 0, 16, 0, + 12, 0, 0, 0, 0, 0, + 0, 7, 66, 0, 16, 0, + 11, 0, 0, 0, -90, 10, + 16, 0, 11, 0, 0, 0, + -10, 15, 16, 0, 11, 0, + 0, 0, 54, 0, 0, 5, +-126, 0, 16, 0, 11, 0, + 0, 0, 6, 8, 16, 0, + 4, 0, 0, 0, 54, 0, + 0, 5, 18, 0, 16, 0, + 12, 0, 0, 0, 22, 0, + 16, 0, 9, 0, 0, 0, + 56, 0, 0, 7,-126, 0, + 16, 0, 11, 0, 0, 0, + -10, 15, 16, 0, 11, 0, + 0, 0, 6, 0, 16, 0, + 12, 0, 0, 0, 0, 0, + 0, 7, 66, 0, 16, 0, + 11, 0, 0, 0, -90, 10, + 16, 0, 11, 0, 0, 0, + -10, 15, 16, 0, 11, 0, + 0, 0, 54, 0, 0, 5, +-126, 0, 16, 0, 11, 0, + 0, 0, 6, 12, 16, 0, + 4, 0, 0, 0, 54, 0, + 0, 5, 18, 0, 16, 0, + 12, 0, 0, 0, 22, 0, + 16, 0, 10, 0, 0, 0, + 56, 0, 0, 7,-126, 0, + 16, 0, 11, 0, 0, 0, + -10, 15, 16, 0, 11, 0, + 0, 0, 6, 0, 16, 0, + 12, 0, 0, 0, 0, 0, + 0, 7, 66, 0, 16, 0, + 11, 0, 0, 0, -90, 10, + 16, 0, 11, 0, 0, 0, + -10, 15, 16, 0, 11, 0, + 0, 0, 54, 0, 0, 5, +-126, 0, 16, 0, 11, 0, + 0, 0, 6, 0, 16, 0, + 5, 0, 0, 0, 54, 0, + 0, 5, 18, 0, 16, 0, + 12, 0, 0, 0, 22, 0, + 16, 0, 7, 0, 0, 0, + 56, 0, 0, 7,-126, 0, + 16, 0, 11, 0, 0, 0, + -10, 15, 16, 0, 11, 0, + 0, 0, 6, 0, 16, 0, + 12, 0, 0, 0, 54, 0, + 0, 5, 18, 0, 16, 0, + 12, 0, 0, 0, 22, 0, + 16, 0, 5, 0, 0, 0, + 54, 0, 0, 5, 34, 0, + 16, 0, 12, 0, 0, 0, + 70, 0, 16, 0, 8, 0, + 0, 0, 56, 0, 0, 7, + 18, 0, 16, 0, 12, 0, + 0, 0, 6, 0, 16, 0, + 12, 0, 0, 0, 86, 5, + 16, 0, 12, 0, 0, 0, + 0, 0, 0, 7,-126, 0, + 16, 0, 11, 0, 0, 0, + -10, 15, 16, 0, 11, 0, + 0, 0, 6, 0, 16, 0, + 12, 0, 0, 0, 54, 0, + 0, 5, 18, 0, 16, 0, + 12, 0, 0, 0, 38, 0, + 16, 0, 5, 0, 0, 0, + 54, 0, 0, 5, 34, 0, + 16, 0, 12, 0, 0, 0, + 70, 0, 16, 0, 9, 0, + 0, 0, 56, 0, 0, 7, + 18, 0, 16, 0, 12, 0, + 0, 0, 6, 0, 16, 0, + 12, 0, 0, 0, 86, 5, + 16, 0, 12, 0, 0, 0, + 0, 0, 0, 7,-126, 0, + 16, 0, 11, 0, 0, 0, + -10, 15, 16, 0, 11, 0, + 0, 0, 6, 0, 16, 0, + 12, 0, 0, 0, 54, 0, + 0, 5, 18, 0, 16, 0, + 12, 0, 0, 0, 54, 0, + 16, 0, 5, 0, 0, 0, + 54, 0, 0, 5, 34, 0, + 16, 0, 12, 0, 0, 0, + 70, 0, 16, 0, 10, 0, + 0, 0, 56, 0, 0, 7, + 18, 0, 16, 0, 12, 0, + 0, 0, 6, 0, 16, 0, + 12, 0, 0, 0, 86, 5, + 16, 0, 12, 0, 0, 0, + 0, 0, 0, 7,-126, 0, + 16, 0, 11, 0, 0, 0, + -10, 15, 16, 0, 11, 0, + 0, 0, 6, 0, 16, 0, + 12, 0, 0, 0, 54, 0, + 0, 5, 18, 0, 16, 0, + 12, 0, 0, 0, 6, 0, + 16, 0, 6, 0, 0, 0, + 54, 0, 0, 5, 34, 0, + 16, 0, 12, 0, 0, 0, + 70, 0, 16, 0, 7, 0, + 0, 0, 56, 0, 0, 7, + 18, 0, 16, 0, 12, 0, + 0, 0, 6, 0, 16, 0, + 12, 0, 0, 0, 86, 5, + 16, 0, 12, 0, 0, 0, + 54, 0, 0, 5, 34, 0, + 16, 0, 12, 0, 0, 0, + 70, 0, 16, 0, 6, 0, + 0, 0, 54, 0, 0, 5, + 66, 0, 16, 0, 12, 0, + 0, 0, 6, 1, 16, 0, + 8, 0, 0, 0, 56, 0, + 0, 7, 34, 0, 16, 0, + 12, 0, 0, 0, 86, 5, + 16, 0, 12, 0, 0, 0, + -90, 10, 16, 0, 12, 0, + 0, 0, 0, 0, 0, 7, + 18, 0, 16, 0, 12, 0, + 0, 0, 6, 0, 16, 0, + 12, 0, 0, 0, 86, 5, + 16, 0, 12, 0, 0, 0, + 54, 0, 0, 5, 34, 0, + 16, 0, 12, 0, 0, 0, +-122, 0, 16, 0, 6, 0, + 0, 0, 54, 0, 0, 5, + 66, 0, 16, 0, 12, 0, + 0, 0, 6, 1, 16, 0, + 9, 0, 0, 0, 56, 0, + 0, 7, 34, 0, 16, 0, + 12, 0, 0, 0, 86, 5, + 16, 0, 12, 0, 0, 0, + -90, 10, 16, 0, 12, 0, + 0, 0, 0, 0, 0, 7, + 18, 0, 16, 0, 12, 0, + 0, 0, 6, 0, 16, 0, + 12, 0, 0, 0, 86, 5, + 16, 0, 12, 0, 0, 0, + 54, 0, 0, 5, 34, 0, + 16, 0, 12, 0, 0, 0, + -58, 0, 16, 0, 6, 0, + 0, 0, 54, 0, 0, 5, + 66, 0, 16, 0, 12, 0, + 0, 0, 6, 1, 16, 0, + 10, 0, 0, 0, 56, 0, + 0, 7, 34, 0, 16, 0, + 12, 0, 0, 0, 86, 5, + 16, 0, 12, 0, 0, 0, + -90, 10, 16, 0, 12, 0, + 0, 0, 0, 0, 0, 7, + 18, 0, 16, 0, 12, 0, + 0, 0, 6, 0, 16, 0, + 12, 0, 0, 0, 86, 5, + 16, 0, 12, 0, 0, 0, + 54, 0, 0, 5, 34, 0, + 16, 0, 12, 0, 0, 0, + 6, 0, 16, 0, 3, 0, + 0, 0, 54, 0, 0, 5, + 66, 0, 16, 0, 12, 0, + 0, 0, 6, 2, 16, 0, + 7, 0, 0, 0, 56, 0, + 0, 7, 34, 0, 16, 0, + 12, 0, 0, 0, 86, 5, + 16, 0, 12, 0, 0, 0, + -90, 10, 16, 0, 12, 0, + 0, 0, 54, 0, 0, 5, + 66, 0, 16, 0, 12, 0, + 0, 0, 6, 1, 16, 0, + 3, 0, 0, 0, 54, 0, + 0, 5,-126, 0, 16, 0, + 12, 0, 0, 0, 6, 8, + 16, 0, 8, 0, 0, 0, + 56, 0, 0, 7, 66, 0, + 16, 0, 12, 0, 0, 0, + -90, 10, 16, 0, 12, 0, + 0, 0, -10, 15, 16, 0, + 12, 0, 0, 0, 0, 0, + 0, 7, 34, 0, 16, 0, + 12, 0, 0, 0, 86, 5, + 16, 0, 12, 0, 0, 0, + -90, 10, 16, 0, 12, 0, + 0, 0, 54, 0, 0, 5, + 66, 0, 16, 0, 12, 0, + 0, 0, 6, 2, 16, 0, + 3, 0, 0, 0, 54, 0, + 0, 5,-126, 0, 16, 0, + 12, 0, 0, 0, 6, 8, + 16, 0, 9, 0, 0, 0, + 56, 0, 0, 7, 66, 0, + 16, 0, 12, 0, 0, 0, + -90, 10, 16, 0, 12, 0, + 0, 0, -10, 15, 16, 0, + 12, 0, 0, 0, 0, 0, + 0, 7, 34, 0, 16, 0, + 12, 0, 0, 0, 86, 5, + 16, 0, 12, 0, 0, 0, + -90, 10, 16, 0, 12, 0, + 0, 0, 54, 0, 0, 5, + 66, 0, 16, 0, 12, 0, + 0, 0, 6, 3, 16, 0, + 3, 0, 0, 0, 54, 0, + 0, 5,-126, 0, 16, 0, + 12, 0, 0, 0, 6, 8, + 16, 0, 10, 0, 0, 0, + 56, 0, 0, 7, 66, 0, + 16, 0, 12, 0, 0, 0, + -90, 10, 16, 0, 12, 0, + 0, 0, -10, 15, 16, 0, + 12, 0, 0, 0, 0, 0, + 0, 7, 34, 0, 16, 0, + 12, 0, 0, 0, 86, 5, + 16, 0, 12, 0, 0, 0, + -90, 10, 16, 0, 12, 0, + 0, 0, 54, 0, 0, 5, + 66, 0, 16, 0, 12, 0, + 0, 0, 6, 0, 16, 0, + 4, 0, 0, 0, 54, 0, + 0, 5,-126, 0, 16, 0, + 12, 0, 0, 0, 6, 8, + 16, 0, 7, 0, 0, 0, + 56, 0, 0, 7, 66, 0, + 16, 0, 12, 0, 0, 0, + -90, 10, 16, 0, 12, 0, + 0, 0, -10, 15, 16, 0, + 12, 0, 0, 0, 54, 0, + 0, 5,-126, 0, 16, 0, + 12, 0, 0, 0, 6, 4, + 16, 0, 4, 0, 0, 0, + 54, 0, 0, 5, 18, 0, + 16, 0, 13, 0, 0, 0, + 38, 0, 16, 0, 8, 0, + 0, 0, 56, 0, 0, 7, +-126, 0, 16, 0, 12, 0, + 0, 0, -10, 15, 16, 0, + 12, 0, 0, 0, 6, 0, + 16, 0, 13, 0, 0, 0, + 0, 0, 0, 7, 66, 0, + 16, 0, 12, 0, 0, 0, + -90, 10, 16, 0, 12, 0, + 0, 0, -10, 15, 16, 0, + 12, 0, 0, 0, 54, 0, + 0, 5,-126, 0, 16, 0, + 12, 0, 0, 0, 6, 8, + 16, 0, 4, 0, 0, 0, + 54, 0, 0, 5, 18, 0, + 16, 0, 13, 0, 0, 0, + 38, 0, 16, 0, 9, 0, + 0, 0, 56, 0, 0, 7, +-126, 0, 16, 0, 12, 0, + 0, 0, -10, 15, 16, 0, + 12, 0, 0, 0, 6, 0, + 16, 0, 13, 0, 0, 0, + 0, 0, 0, 7, 66, 0, + 16, 0, 12, 0, 0, 0, + -90, 10, 16, 0, 12, 0, + 0, 0, -10, 15, 16, 0, + 12, 0, 0, 0, 54, 0, + 0, 5,-126, 0, 16, 0, + 12, 0, 0, 0, 6, 12, + 16, 0, 4, 0, 0, 0, + 54, 0, 0, 5, 18, 0, + 16, 0, 13, 0, 0, 0, + 38, 0, 16, 0, 10, 0, + 0, 0, 56, 0, 0, 7, +-126, 0, 16, 0, 12, 0, + 0, 0, -10, 15, 16, 0, + 12, 0, 0, 0, 6, 0, + 16, 0, 13, 0, 0, 0, + 0, 0, 0, 7, 66, 0, + 16, 0, 12, 0, 0, 0, + -90, 10, 16, 0, 12, 0, + 0, 0, -10, 15, 16, 0, + 12, 0, 0, 0, 54, 0, + 0, 5,-126, 0, 16, 0, + 12, 0, 0, 0, 6, 0, + 16, 0, 5, 0, 0, 0, + 54, 0, 0, 5, 18, 0, + 16, 0, 13, 0, 0, 0, + 38, 0, 16, 0, 7, 0, + 0, 0, 56, 0, 0, 7, +-126, 0, 16, 0, 12, 0, + 0, 0, -10, 15, 16, 0, + 12, 0, 0, 0, 6, 0, + 16, 0, 13, 0, 0, 0, + 54, 0, 0, 5, 18, 0, + 16, 0, 13, 0, 0, 0, + 22, 0, 16, 0, 5, 0, + 0, 0, 54, 0, 0, 5, + 34, 0, 16, 0, 13, 0, + 0, 0,-122, 0, 16, 0, + 8, 0, 0, 0, 56, 0, + 0, 7, 18, 0, 16, 0, + 13, 0, 0, 0, 6, 0, + 16, 0, 13, 0, 0, 0, + 86, 5, 16, 0, 13, 0, + 0, 0, 0, 0, 0, 7, +-126, 0, 16, 0, 12, 0, + 0, 0, -10, 15, 16, 0, + 12, 0, 0, 0, 6, 0, + 16, 0, 13, 0, 0, 0, + 54, 0, 0, 5, 18, 0, + 16, 0, 13, 0, 0, 0, + 38, 0, 16, 0, 5, 0, + 0, 0, 54, 0, 0, 5, + 34, 0, 16, 0, 13, 0, + 0, 0,-122, 0, 16, 0, + 9, 0, 0, 0, 56, 0, + 0, 7, 18, 0, 16, 0, + 13, 0, 0, 0, 6, 0, + 16, 0, 13, 0, 0, 0, + 86, 5, 16, 0, 13, 0, + 0, 0, 0, 0, 0, 7, +-126, 0, 16, 0, 12, 0, + 0, 0, -10, 15, 16, 0, + 12, 0, 0, 0, 6, 0, + 16, 0, 13, 0, 0, 0, + 54, 0, 0, 5, 18, 0, + 16, 0, 13, 0, 0, 0, + 54, 0, 16, 0, 5, 0, + 0, 0, 54, 0, 0, 5, + 34, 0, 16, 0, 13, 0, + 0, 0,-122, 0, 16, 0, + 10, 0, 0, 0, 56, 0, + 0, 7, 18, 0, 16, 0, + 13, 0, 0, 0, 6, 0, + 16, 0, 13, 0, 0, 0, + 86, 5, 16, 0, 13, 0, + 0, 0, 0, 0, 0, 7, +-126, 0, 16, 0, 12, 0, + 0, 0, -10, 15, 16, 0, + 12, 0, 0, 0, 6, 0, + 16, 0, 13, 0, 0, 0, + 54, 0, 0, 5, 18, 0, + 16, 0, 13, 0, 0, 0, + 6, 0, 16, 0, 6, 0, + 0, 0, 54, 0, 0, 5, + 34, 0, 16, 0, 13, 0, + 0, 0,-122, 0, 16, 0, + 7, 0, 0, 0, 56, 0, + 0, 7, 18, 0, 16, 0, + 13, 0, 0, 0, 6, 0, + 16, 0, 13, 0, 0, 0, + 86, 5, 16, 0, 13, 0, + 0, 0, 54, 0, 0, 5, + 34, 0, 16, 0, 13, 0, + 0, 0, 70, 0, 16, 0, + 6, 0, 0, 0, 54, 0, + 0, 5, 66, 0, 16, 0, + 13, 0, 0, 0, 6, 2, + 16, 0, 8, 0, 0, 0, + 56, 0, 0, 7, 34, 0, + 16, 0, 13, 0, 0, 0, + 86, 5, 16, 0, 13, 0, + 0, 0, -90, 10, 16, 0, + 13, 0, 0, 0, 0, 0, + 0, 7, 18, 0, 16, 0, + 13, 0, 0, 0, 6, 0, + 16, 0, 13, 0, 0, 0, + 86, 5, 16, 0, 13, 0, + 0, 0, 54, 0, 0, 5, + 34, 0, 16, 0, 13, 0, + 0, 0,-122, 0, 16, 0, + 6, 0, 0, 0, 54, 0, + 0, 5, 66, 0, 16, 0, + 13, 0, 0, 0, 6, 2, + 16, 0, 9, 0, 0, 0, + 56, 0, 0, 7, 34, 0, + 16, 0, 13, 0, 0, 0, + 86, 5, 16, 0, 13, 0, + 0, 0, -90, 10, 16, 0, + 13, 0, 0, 0, 0, 0, + 0, 7, 18, 0, 16, 0, + 13, 0, 0, 0, 6, 0, + 16, 0, 13, 0, 0, 0, + 86, 5, 16, 0, 13, 0, + 0, 0, 54, 0, 0, 5, + 34, 0, 16, 0, 13, 0, + 0, 0, -58, 0, 16, 0, + 6, 0, 0, 0, 54, 0, + 0, 5, 66, 0, 16, 0, + 13, 0, 0, 0, 6, 2, + 16, 0, 10, 0, 0, 0, + 56, 0, 0, 7, 34, 0, + 16, 0, 13, 0, 0, 0, + 86, 5, 16, 0, 13, 0, + 0, 0, -90, 10, 16, 0, + 13, 0, 0, 0, 0, 0, + 0, 7, 18, 0, 16, 0, + 13, 0, 0, 0, 6, 0, + 16, 0, 13, 0, 0, 0, + 86, 5, 16, 0, 13, 0, + 0, 0, 54, 0, 0, 5, + 34, 0, 16, 0, 13, 0, + 0, 0, 6, 0, 16, 0, + 3, 0, 0, 0, 54, 0, + 0, 5, 66, 0, 16, 0, + 13, 0, 0, 0, 6, 3, + 16, 0, 7, 0, 0, 0, + 56, 0, 0, 7, 34, 0, + 16, 0, 13, 0, 0, 0, + 86, 5, 16, 0, 13, 0, + 0, 0, -90, 10, 16, 0, + 13, 0, 0, 0, 54, 0, + 0, 5, 66, 0, 16, 0, + 13, 0, 0, 0, 6, 1, + 16, 0, 3, 0, 0, 0, + 54, 0, 0, 5,-126, 0, + 16, 0, 13, 0, 0, 0, + 6, 12, 16, 0, 8, 0, + 0, 0, 56, 0, 0, 7, + 66, 0, 16, 0, 13, 0, + 0, 0, -90, 10, 16, 0, + 13, 0, 0, 0, -10, 15, + 16, 0, 13, 0, 0, 0, + 0, 0, 0, 7, 34, 0, + 16, 0, 13, 0, 0, 0, + 86, 5, 16, 0, 13, 0, + 0, 0, -90, 10, 16, 0, + 13, 0, 0, 0, 54, 0, + 0, 5, 66, 0, 16, 0, + 13, 0, 0, 0, 6, 2, + 16, 0, 3, 0, 0, 0, + 54, 0, 0, 5,-126, 0, + 16, 0, 13, 0, 0, 0, + 6, 12, 16, 0, 9, 0, + 0, 0, 56, 0, 0, 7, + 66, 0, 16, 0, 13, 0, + 0, 0, -90, 10, 16, 0, + 13, 0, 0, 0, -10, 15, + 16, 0, 13, 0, 0, 0, + 0, 0, 0, 7, 34, 0, + 16, 0, 13, 0, 0, 0, + 86, 5, 16, 0, 13, 0, + 0, 0, -90, 10, 16, 0, + 13, 0, 0, 0, 54, 0, + 0, 5, 18, 0, 16, 0, + 3, 0, 0, 0, 54, 0, + 16, 0, 3, 0, 0, 0, + 54, 0, 0, 5, 34, 0, + 16, 0, 3, 0, 0, 0, + -58, 0, 16, 0, 10, 0, + 0, 0, 56, 0, 0, 7, + 18, 0, 16, 0, 3, 0, + 0, 0, 6, 0, 16, 0, + 3, 0, 0, 0, 86, 5, + 16, 0, 3, 0, 0, 0, + 0, 0, 0, 7, 18, 0, + 16, 0, 3, 0, 0, 0, + 86, 5, 16, 0, 13, 0, + 0, 0, 6, 0, 16, 0, + 3, 0, 0, 0, 54, 0, + 0, 5, 34, 0, 16, 0, + 3, 0, 0, 0, 6, 0, + 16, 0, 4, 0, 0, 0, + 54, 0, 0, 5, 66, 0, + 16, 0, 3, 0, 0, 0, + 6, 3, 16, 0, 7, 0, + 0, 0, 56, 0, 0, 7, + 34, 0, 16, 0, 3, 0, + 0, 0, 86, 5, 16, 0, + 3, 0, 0, 0, -90, 10, + 16, 0, 3, 0, 0, 0, + 54, 0, 0, 5, 66, 0, + 16, 0, 3, 0, 0, 0, + 6, 1, 16, 0, 4, 0, + 0, 0, 54, 0, 0, 5, +-126, 0, 16, 0, 3, 0, + 0, 0, 6, 12, 16, 0, + 8, 0, 0, 0, 56, 0, + 0, 7, 66, 0, 16, 0, + 3, 0, 0, 0, -90, 10, + 16, 0, 3, 0, 0, 0, + -10, 15, 16, 0, 3, 0, + 0, 0, 0, 0, 0, 7, + 34, 0, 16, 0, 3, 0, + 0, 0, 86, 5, 16, 0, + 3, 0, 0, 0, -90, 10, + 16, 0, 3, 0, 0, 0, + 54, 0, 0, 5, 66, 0, + 16, 0, 3, 0, 0, 0, + 6, 2, 16, 0, 4, 0, + 0, 0, 54, 0, 0, 5, +-126, 0, 16, 0, 3, 0, + 0, 0, 6, 12, 16, 0, + 9, 0, 0, 0, 56, 0, + 0, 7, 66, 0, 16, 0, + 3, 0, 0, 0, -90, 10, + 16, 0, 3, 0, 0, 0, + -10, 15, 16, 0, 3, 0, + 0, 0, 0, 0, 0, 7, + 34, 0, 16, 0, 3, 0, + 0, 0, 86, 5, 16, 0, + 3, 0, 0, 0, -90, 10, + 16, 0, 3, 0, 0, 0, + 54, 0, 0, 5, 66, 0, + 16, 0, 3, 0, 0, 0, + 6, 3, 16, 0, 4, 0, + 0, 0, 54, 0, 0, 5, +-126, 0, 16, 0, 3, 0, + 0, 0, 6, 12, 16, 0, + 10, 0, 0, 0, 56, 0, + 0, 7, 66, 0, 16, 0, + 3, 0, 0, 0, -90, 10, + 16, 0, 3, 0, 0, 0, + -10, 15, 16, 0, 3, 0, + 0, 0, 0, 0, 0, 7, + 34, 0, 16, 0, 3, 0, + 0, 0, 86, 5, 16, 0, + 3, 0, 0, 0, -90, 10, + 16, 0, 3, 0, 0, 0, + 54, 0, 0, 5, 66, 0, + 16, 0, 3, 0, 0, 0, + 6, 0, 16, 0, 5, 0, + 0, 0, 54, 0, 0, 5, +-126, 0, 16, 0, 3, 0, + 0, 0, 6, 12, 16, 0, + 7, 0, 0, 0, 56, 0, + 0, 7, 66, 0, 16, 0, + 3, 0, 0, 0, -90, 10, + 16, 0, 3, 0, 0, 0, + -10, 15, 16, 0, 3, 0, + 0, 0, 54, 0, 0, 5, +-126, 0, 16, 0, 3, 0, + 0, 0, 6, 4, 16, 0, + 5, 0, 0, 0, 54, 0, + 0, 5, 18, 0, 16, 0, + 4, 0, 0, 0, 54, 0, + 16, 0, 8, 0, 0, 0, + 56, 0, 0, 7,-126, 0, + 16, 0, 3, 0, 0, 0, + -10, 15, 16, 0, 3, 0, + 0, 0, 6, 0, 16, 0, + 4, 0, 0, 0, 0, 0, + 0, 7, 66, 0, 16, 0, + 3, 0, 0, 0, -90, 10, + 16, 0, 3, 0, 0, 0, + -10, 15, 16, 0, 3, 0, + 0, 0, 54, 0, 0, 5, +-126, 0, 16, 0, 3, 0, + 0, 0, 6, 8, 16, 0, + 5, 0, 0, 0, 54, 0, + 0, 5, 18, 0, 16, 0, + 4, 0, 0, 0, 54, 0, + 16, 0, 9, 0, 0, 0, + 56, 0, 0, 7,-126, 0, + 16, 0, 3, 0, 0, 0, + -10, 15, 16, 0, 3, 0, + 0, 0, 6, 0, 16, 0, + 4, 0, 0, 0, 0, 0, + 0, 7, 66, 0, 16, 0, + 3, 0, 0, 0, -90, 10, + 16, 0, 3, 0, 0, 0, + -10, 15, 16, 0, 3, 0, + 0, 0, 54, 0, 0, 5, +-126, 0, 16, 0, 3, 0, + 0, 0, 6, 12, 16, 0, + 5, 0, 0, 0, 54, 0, + 0, 5, 18, 0, 16, 0, + 4, 0, 0, 0, 54, 0, + 16, 0, 10, 0, 0, 0, + 56, 0, 0, 7,-126, 0, + 16, 0, 3, 0, 0, 0, + -10, 15, 16, 0, 3, 0, + 0, 0, 6, 0, 16, 0, + 4, 0, 0, 0, 0, 0, + 0, 7, 66, 0, 16, 0, + 3, 0, 0, 0, -90, 10, + 16, 0, 3, 0, 0, 0, + -10, 15, 16, 0, 3, 0, + 0, 0, 54, 0, 0, 5, +-126, 0, 16, 0, 3, 0, + 0, 0, 6, 0, 16, 0, + 6, 0, 0, 0, 54, 0, + 0, 5, 18, 0, 16, 0, + 4, 0, 0, 0, 54, 0, + 16, 0, 7, 0, 0, 0, + 56, 0, 0, 7,-126, 0, + 16, 0, 3, 0, 0, 0, + -10, 15, 16, 0, 3, 0, + 0, 0, 6, 0, 16, 0, + 4, 0, 0, 0, 54, 0, + 0, 5, 18, 0, 16, 0, + 4, 0, 0, 0, 22, 0, + 16, 0, 6, 0, 0, 0, + 54, 0, 0, 5, 34, 0, + 16, 0, 4, 0, 0, 0, + -58, 0, 16, 0, 8, 0, + 0, 0, 56, 0, 0, 7, + 18, 0, 16, 0, 4, 0, + 0, 0, 6, 0, 16, 0, + 4, 0, 0, 0, 86, 5, + 16, 0, 4, 0, 0, 0, + 0, 0, 0, 7,-126, 0, + 16, 0, 3, 0, 0, 0, + -10, 15, 16, 0, 3, 0, + 0, 0, 6, 0, 16, 0, + 4, 0, 0, 0, 54, 0, + 0, 5, 18, 0, 16, 0, + 4, 0, 0, 0, 38, 0, + 16, 0, 6, 0, 0, 0, + 54, 0, 0, 5, 34, 0, + 16, 0, 4, 0, 0, 0, + -58, 0, 16, 0, 9, 0, + 0, 0, 56, 0, 0, 7, + 18, 0, 16, 0, 4, 0, + 0, 0, 6, 0, 16, 0, + 4, 0, 0, 0, 86, 5, + 16, 0, 4, 0, 0, 0, + 0, 0, 0, 7,-126, 0, + 16, 0, 3, 0, 0, 0, + -10, 15, 16, 0, 3, 0, + 0, 0, 6, 0, 16, 0, + 4, 0, 0, 0, 54, 0, + 0, 5, 18, 0, 16, 0, + 4, 0, 0, 0, 54, 0, + 16, 0, 6, 0, 0, 0, + 54, 0, 0, 5, 34, 0, + 16, 0, 4, 0, 0, 0, + -58, 0, 16, 0, 10, 0, + 0, 0, 56, 0, 0, 7, + 18, 0, 16, 0, 4, 0, + 0, 0, 6, 0, 16, 0, + 4, 0, 0, 0, 86, 5, + 16, 0, 4, 0, 0, 0, + 0, 0, 0, 7,-126, 0, + 16, 0, 3, 0, 0, 0, + -10, 15, 16, 0, 3, 0, + 0, 0, 6, 0, 16, 0, + 4, 0, 0, 0, 54, 0, + 0, 5, 18, 0, 16, 0, + 4, 0, 0, 0, 6, 0, + 16, 0, 2, 0, 0, 0, + 56, 0, 0, 7, 66, 0, + 16, 0, 0, 0, 0, 0, + 6, 0, 16, 0, 4, 0, + 0, 0, -90, 10, 16, 0, + 0, 0, 0, 0, 54, 0, + 0, 5, 18, 0, 16, 0, + 4, 0, 0, 0, 22, 0, + 16, 0, 2, 0, 0, 0, + 56, 0, 0, 7,-126, 0, + 16, 0, 0, 0, 0, 0, + 6, 0, 16, 0, 4, 0, + 0, 0, -10, 15, 16, 0, + 0, 0, 0, 0, 0, 0, + 0, 7, 66, 0, 16, 0, + 0, 0, 0, 0, -90, 10, + 16, 0, 0, 0, 0, 0, + -10, 15, 16, 0, 0, 0, + 0, 0, 54, 0, 0, 5, +-126, 0, 16, 0, 0, 0, + 0, 0, 6, 8, 16, 0, + 2, 0, 0, 0, 56, 0, + 0, 7,-126, 0, 16, 0, + 0, 0, 0, 0, -10, 15, + 16, 0, 0, 0, 0, 0, + -10, 15, 16, 0, 2, 0, + 0, 0, 0, 0, 0, 7, + 66, 0, 16, 0, 0, 0, + 0, 0, -90, 10, 16, 0, + 0, 0, 0, 0, -10, 15, + 16, 0, 0, 0, 0, 0, + 56, 0, 0, 7,-126, 0, + 16, 0, 0, 0, 0, 0, + 1, 64, 0, 0, 0, 0, +-128, 63, 6, 0, 16, 0, + 11, 0, 0, 0, 0, 0, + 0, 7, 66, 0, 16, 0, + 0, 0, 0, 0, -90, 10, + 16, 0, 0, 0, 0, 0, + -10, 15, 16, 0, 0, 0, + 0, 0, 54, 0, 0, 5, +-126, 0, 16, 0, 0, 0, + 0, 0, 6, 0, 16, 0, + 2, 0, 0, 0, 56, 0, + 0, 7,-126, 0, 16, 0, + 0, 0, 0, 0, -10, 15, + 16, 0, 0, 0, 0, 0, + 86, 5, 16, 0, 11, 0, + 0, 0, 54, 0, 0, 5, +-126, 0, 16, 0, 2, 0, + 0, 0, 6, 4, 16, 0, + 2, 0, 0, 0, 56, 0, + 0, 7,-126, 0, 16, 0, + 2, 0, 0, 0, -10, 15, + 16, 0, 2, 0, 0, 0, + -90, 10, 16, 0, 11, 0, + 0, 0, 0, 0, 0, 7, +-126, 0, 16, 0, 0, 0, + 0, 0, -10, 15, 16, 0, + 0, 0, 0, 0, -10, 15, + 16, 0, 2, 0, 0, 0, + 54, 0, 0, 5,-126, 0, + 16, 0, 2, 0, 0, 0, + 6, 8, 16, 0, 2, 0, + 0, 0, 56, 0, 0, 7, +-126, 0, 16, 0, 2, 0, + 0, 0, -10, 15, 16, 0, + 2, 0, 0, 0, -10, 15, + 16, 0, 11, 0, 0, 0, + 0, 0, 0, 7,-126, 0, + 16, 0, 0, 0, 0, 0, + -10, 15, 16, 0, 0, 0, + 0, 0, -10, 15, 16, 0, + 2, 0, 0, 0, 56, 0, + 0, 7,-126, 0, 16, 0, + 2, 0, 0, 0, 1, 64, + 0, 0, 0, 0,-128, 63, + 6, 0, 16, 0, 12, 0, + 0, 0, 0, 0, 0, 7, +-126, 0, 16, 0, 0, 0, + 0, 0, -10, 15, 16, 0, + 0, 0, 0, 0, -10, 15, + 16, 0, 2, 0, 0, 0, + 54, 0, 0, 5,-126, 0, + 16, 0, 2, 0, 0, 0, + 6, 0, 16, 0, 2, 0, + 0, 0, 56, 0, 0, 7, +-126, 0, 16, 0, 2, 0, + 0, 0, -10, 15, 16, 0, + 2, 0, 0, 0, 86, 5, + 16, 0, 12, 0, 0, 0, + 54, 0, 0, 5, 18, 0, + 16, 0, 4, 0, 0, 0, + 22, 0, 16, 0, 2, 0, + 0, 0, 56, 0, 0, 7, + 18, 0, 16, 0, 4, 0, + 0, 0, 6, 0, 16, 0, + 4, 0, 0, 0, -90, 10, + 16, 0, 12, 0, 0, 0, + 0, 0, 0, 7,-126, 0, + 16, 0, 2, 0, 0, 0, + -10, 15, 16, 0, 2, 0, + 0, 0, 6, 0, 16, 0, + 4, 0, 0, 0, 54, 0, + 0, 5, 18, 0, 16, 0, + 4, 0, 0, 0, 38, 0, + 16, 0, 2, 0, 0, 0, + 56, 0, 0, 7, 18, 0, + 16, 0, 4, 0, 0, 0, + 6, 0, 16, 0, 4, 0, + 0, 0, -10, 15, 16, 0, + 12, 0, 0, 0, 0, 0, + 0, 7,-126, 0, 16, 0, + 2, 0, 0, 0, -10, 15, + 16, 0, 2, 0, 0, 0, + 6, 0, 16, 0, 4, 0, + 0, 0, 56, 0, 0, 7, + 18, 0, 16, 0, 4, 0, + 0, 0, 1, 64, 0, 0, + 0, 0,-128, 63, 6, 0, + 16, 0, 13, 0, 0, 0, + 0, 0, 0, 7,-126, 0, + 16, 0, 2, 0, 0, 0, + -10, 15, 16, 0, 2, 0, + 0, 0, 6, 0, 16, 0, + 4, 0, 0, 0, 54, 0, + 0, 5, 18, 0, 16, 0, + 4, 0, 0, 0, 6, 0, + 16, 0, 2, 0, 0, 0, + 56, 0, 0, 7, 18, 0, + 16, 0, 3, 0, 0, 0, + 6, 0, 16, 0, 4, 0, + 0, 0, 6, 0, 16, 0, + 3, 0, 0, 0, 54, 0, + 0, 5, 18, 0, 16, 0, + 4, 0, 0, 0, 22, 0, + 16, 0, 2, 0, 0, 0, + 56, 0, 0, 7, 34, 0, + 16, 0, 3, 0, 0, 0, + 6, 0, 16, 0, 4, 0, + 0, 0, 86, 5, 16, 0, + 3, 0, 0, 0, 0, 0, + 0, 7, 18, 0, 16, 0, + 3, 0, 0, 0, 6, 0, + 16, 0, 3, 0, 0, 0, + 86, 5, 16, 0, 3, 0, + 0, 0, 54, 0, 0, 5, + 18, 0, 16, 0, 2, 0, + 0, 0, 38, 0, 16, 0, + 2, 0, 0, 0, 56, 0, + 0, 7, 18, 0, 16, 0, + 2, 0, 0, 0, 6, 0, + 16, 0, 2, 0, 0, 0, + -90, 10, 16, 0, 3, 0, + 0, 0, 0, 0, 0, 7, + 18, 0, 16, 0, 2, 0, + 0, 0, 6, 0, 16, 0, + 3, 0, 0, 0, 6, 0, + 16, 0, 2, 0, 0, 0, + 56, 0, 0, 7, 34, 0, + 16, 0, 2, 0, 0, 0, + 1, 64, 0, 0, 0, 0, +-128, 63, -10, 15, 16, 0, + 3, 0, 0, 0, 0, 0, + 0, 7, 18, 0, 16, 0, + 2, 0, 0, 0, 6, 0, + 16, 0, 2, 0, 0, 0, + 86, 5, 16, 0, 2, 0, + 0, 0, 54, 0, 0, 5, + 18, 0, 16, 0, 3, 0, + 0, 0, -90, 10, 16, 0, + 0, 0, 0, 0, 54, 0, + 0, 5, 34, 0, 16, 0, + 3, 0, 0, 0, -10, 15, + 16, 0, 0, 0, 0, 0, + 54, 0, 0, 5, 66, 0, + 16, 0, 3, 0, 0, 0, + -10, 15, 16, 0, 2, 0, + 0, 0, 54, 0, 0, 5, +-126, 0, 16, 0, 3, 0, + 0, 0, 6, 0, 16, 0, + 2, 0, 0, 0, 54, 0, + 0, 5, -14, 0, 16, 0, + 2, 0, 0, 0, 70, 14, + 16, 0, 3, 0, 0, 0, + 54, 0, 0, 5, -14, 32, + 16, 0, 0, 0, 0, 0, + 70, 14, 16, 0, 1, 0, + 0, 0, 54, 0, 0, 5, + 50, 32, 16, 0, 1, 0, + 0, 0, 70, 0, 16, 0, + 0, 0, 0, 0, 54, 0, + 0, 5, -14, 32, 16, 0, + 2, 0, 0, 0, 70, 14, + 16, 0, 2, 0, 0, 0, + 62, 0, 0, 1 +}; diff --git a/examples/testgputext/shaders/shader.vert.sm50.hlsl b/examples/testgputext/shaders/shader.vert.sm50.hlsl new file mode 100644 index 00000000..3a038ab9 --- /dev/null +++ b/examples/testgputext/shaders/shader.vert.sm50.hlsl @@ -0,0 +1,47 @@ +cbuffer _28_30 : register(b0) +{ + row_major float4x4 _30_m0 : packoffset(c0); + row_major float4x4 _30_m1 : packoffset(c4); +}; + + +static float4 gl_Position; +static float4 _9; +static float4 _11; +static float2 _15; +static float2 _17; +static float3 _40; + +struct SPIRV_Cross_Input +{ + float3 _40 : TEXCOORD0; + float4 _11 : TEXCOORD1; + float2 _17 : TEXCOORD2; +}; + +struct SPIRV_Cross_Output +{ + float4 _9 : TEXCOORD0; + float2 _15 : TEXCOORD1; + float4 gl_Position : SV_Position; +}; + +void vert_main() +{ + _9 = _11; + _15 = _17; + gl_Position = mul(float4(_40, 1.0f), mul(_30_m1, _30_m0)); +} + +SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) +{ + _11 = stage_input._11; + _17 = stage_input._17; + _40 = stage_input._40; + vert_main(); + SPIRV_Cross_Output stage_output; + stage_output.gl_Position = gl_Position; + stage_output._9 = _9; + stage_output._15 = _15; + return stage_output; +} diff --git a/examples/testgputext/shaders/shader.vert.sm60.dxil.h b/examples/testgputext/shaders/shader.vert.sm60.dxil.h new file mode 100644 index 00000000..2e735c65 --- /dev/null +++ b/examples/testgputext/shaders/shader.vert.sm60.dxil.h @@ -0,0 +1,723 @@ +#if 0 +; +; Input signature: +; +; Name Index Mask Register SysValue Format Used +; -------------------- ----- ------ -------- -------- ------- ------ +; TEXCOORD 0 xyz 0 NONE float xyz +; TEXCOORD 1 xyzw 1 NONE float xyzw +; TEXCOORD 2 xy 2 NONE float xy +; +; +; Output signature: +; +; Name Index Mask Register SysValue Format Used +; -------------------- ----- ------ -------- -------- ------- ------ +; TEXCOORD 0 xyzw 0 NONE float xyzw +; TEXCOORD 1 xy 1 NONE float xy +; SV_Position 0 xyzw 2 POS float xyzw +; +; shader hash: 309ff3c535c3f78f8cbd63fc70613d2f +; +; Pipeline Runtime Information: +; +; Vertex Shader +; OutputPositionPresent=1 +; +; +; Input signature: +; +; Name Index InterpMode DynIdx +; -------------------- ----- ---------------------- ------ +; TEXCOORD 0 +; TEXCOORD 1 +; TEXCOORD 2 +; +; Output signature: +; +; Name Index InterpMode DynIdx +; -------------------- ----- ---------------------- ------ +; TEXCOORD 0 linear +; TEXCOORD 1 linear +; SV_Position 0 noperspective +; +; Buffer Definitions: +; +; cbuffer _28_30 +; { +; +; struct hostlayout._28_30 +; { +; +; row_major float4x4 _30_m0; ; Offset: 0 +; row_major float4x4 _30_m1; ; Offset: 64 +; +; } _28_30; ; Offset: 0 Size: 128 +; +; } +; +; +; Resource Bindings: +; +; Name Type Format Dim ID HLSL Bind Count +; ------------------------------ ---------- ------- ----------- ------- -------------- ------ +; _28_30 cbuffer NA NA CB0 cb0,space1 1 +; +; +; ViewId state: +; +; Number of inputs: 10, outputs: 12 +; Outputs dependent on ViewId: { } +; Inputs contributing to computation of Outputs: +; output 0 depends on inputs: { 4 } +; output 1 depends on inputs: { 5 } +; output 2 depends on inputs: { 6 } +; output 3 depends on inputs: { 7 } +; output 4 depends on inputs: { 8 } +; output 5 depends on inputs: { 9 } +; output 8 depends on inputs: { 0, 1, 2 } +; output 9 depends on inputs: { 0, 1, 2 } +; output 10 depends on inputs: { 0, 1, 2 } +; output 11 depends on inputs: { 0, 1, 2 } +; +target datalayout = "e-m:e-p:32:32-i1:32-i8:32-i16:32-i32:32-i64:64-f16:32-f32:32-f64:64-n8:16:32:64" +target triple = "dxil-ms-dx" + +%dx.types.Handle = type { i8* } +%dx.types.CBufRet.f32 = type { float, float, float, float } +%hostlayout._28_30 = type { [4 x <4 x float>], [4 x <4 x float>] } + +define void @main() { + %1 = call %dx.types.Handle @dx.op.createHandle(i32 57, i8 2, i32 0, i32 0, i1 false) ; CreateHandle(resourceClass,rangeId,index,nonUniformIndex) + %2 = call float @dx.op.loadInput.f32(i32 4, i32 2, i32 0, i8 0, i32 undef) ; LoadInput(inputSigId,rowIndex,colIndex,gsVertexAxis) + %3 = call float @dx.op.loadInput.f32(i32 4, i32 2, i32 0, i8 1, i32 undef) ; LoadInput(inputSigId,rowIndex,colIndex,gsVertexAxis) + %4 = call float @dx.op.loadInput.f32(i32 4, i32 1, i32 0, i8 0, i32 undef) ; LoadInput(inputSigId,rowIndex,colIndex,gsVertexAxis) + %5 = call float @dx.op.loadInput.f32(i32 4, i32 1, i32 0, i8 1, i32 undef) ; LoadInput(inputSigId,rowIndex,colIndex,gsVertexAxis) + %6 = call float @dx.op.loadInput.f32(i32 4, i32 1, i32 0, i8 2, i32 undef) ; LoadInput(inputSigId,rowIndex,colIndex,gsVertexAxis) + %7 = call float @dx.op.loadInput.f32(i32 4, i32 1, i32 0, i8 3, i32 undef) ; LoadInput(inputSigId,rowIndex,colIndex,gsVertexAxis) + %8 = call float @dx.op.loadInput.f32(i32 4, i32 0, i32 0, i8 0, i32 undef) ; LoadInput(inputSigId,rowIndex,colIndex,gsVertexAxis) + %9 = call float @dx.op.loadInput.f32(i32 4, i32 0, i32 0, i8 1, i32 undef) ; LoadInput(inputSigId,rowIndex,colIndex,gsVertexAxis) + %10 = call float @dx.op.loadInput.f32(i32 4, i32 0, i32 0, i8 2, i32 undef) ; LoadInput(inputSigId,rowIndex,colIndex,gsVertexAxis) + %11 = call %dx.types.CBufRet.f32 @dx.op.cbufferLoadLegacy.f32(i32 59, %dx.types.Handle %1, i32 0) ; CBufferLoadLegacy(handle,regIndex) + %12 = extractvalue %dx.types.CBufRet.f32 %11, 0 + %13 = extractvalue %dx.types.CBufRet.f32 %11, 1 + %14 = extractvalue %dx.types.CBufRet.f32 %11, 2 + %15 = extractvalue %dx.types.CBufRet.f32 %11, 3 + %16 = call %dx.types.CBufRet.f32 @dx.op.cbufferLoadLegacy.f32(i32 59, %dx.types.Handle %1, i32 1) ; CBufferLoadLegacy(handle,regIndex) + %17 = extractvalue %dx.types.CBufRet.f32 %16, 0 + %18 = extractvalue %dx.types.CBufRet.f32 %16, 1 + %19 = extractvalue %dx.types.CBufRet.f32 %16, 2 + %20 = extractvalue %dx.types.CBufRet.f32 %16, 3 + %21 = call %dx.types.CBufRet.f32 @dx.op.cbufferLoadLegacy.f32(i32 59, %dx.types.Handle %1, i32 2) ; CBufferLoadLegacy(handle,regIndex) + %22 = extractvalue %dx.types.CBufRet.f32 %21, 0 + %23 = extractvalue %dx.types.CBufRet.f32 %21, 1 + %24 = extractvalue %dx.types.CBufRet.f32 %21, 2 + %25 = extractvalue %dx.types.CBufRet.f32 %21, 3 + %26 = call %dx.types.CBufRet.f32 @dx.op.cbufferLoadLegacy.f32(i32 59, %dx.types.Handle %1, i32 3) ; CBufferLoadLegacy(handle,regIndex) + %27 = extractvalue %dx.types.CBufRet.f32 %26, 0 + %28 = extractvalue %dx.types.CBufRet.f32 %26, 1 + %29 = extractvalue %dx.types.CBufRet.f32 %26, 2 + %30 = extractvalue %dx.types.CBufRet.f32 %26, 3 + %31 = call %dx.types.CBufRet.f32 @dx.op.cbufferLoadLegacy.f32(i32 59, %dx.types.Handle %1, i32 4) ; CBufferLoadLegacy(handle,regIndex) + %32 = extractvalue %dx.types.CBufRet.f32 %31, 0 + %33 = extractvalue %dx.types.CBufRet.f32 %31, 1 + %34 = extractvalue %dx.types.CBufRet.f32 %31, 2 + %35 = extractvalue %dx.types.CBufRet.f32 %31, 3 + %36 = call %dx.types.CBufRet.f32 @dx.op.cbufferLoadLegacy.f32(i32 59, %dx.types.Handle %1, i32 5) ; CBufferLoadLegacy(handle,regIndex) + %37 = extractvalue %dx.types.CBufRet.f32 %36, 0 + %38 = extractvalue %dx.types.CBufRet.f32 %36, 1 + %39 = extractvalue %dx.types.CBufRet.f32 %36, 2 + %40 = extractvalue %dx.types.CBufRet.f32 %36, 3 + %41 = call %dx.types.CBufRet.f32 @dx.op.cbufferLoadLegacy.f32(i32 59, %dx.types.Handle %1, i32 6) ; CBufferLoadLegacy(handle,regIndex) + %42 = extractvalue %dx.types.CBufRet.f32 %41, 0 + %43 = extractvalue %dx.types.CBufRet.f32 %41, 1 + %44 = extractvalue %dx.types.CBufRet.f32 %41, 2 + %45 = extractvalue %dx.types.CBufRet.f32 %41, 3 + %46 = call %dx.types.CBufRet.f32 @dx.op.cbufferLoadLegacy.f32(i32 59, %dx.types.Handle %1, i32 7) ; CBufferLoadLegacy(handle,regIndex) + %47 = extractvalue %dx.types.CBufRet.f32 %46, 0 + %48 = extractvalue %dx.types.CBufRet.f32 %46, 1 + %49 = extractvalue %dx.types.CBufRet.f32 %46, 2 + %50 = extractvalue %dx.types.CBufRet.f32 %46, 3 + %51 = fmul fast float %32, %12 + %52 = call float @dx.op.tertiary.f32(i32 46, float %33, float %17, float %51) ; FMad(a,b,c) + %53 = call float @dx.op.tertiary.f32(i32 46, float %34, float %22, float %52) ; FMad(a,b,c) + %54 = call float @dx.op.tertiary.f32(i32 46, float %35, float %27, float %53) ; FMad(a,b,c) + %55 = fmul fast float %32, %13 + %56 = call float @dx.op.tertiary.f32(i32 46, float %33, float %18, float %55) ; FMad(a,b,c) + %57 = call float @dx.op.tertiary.f32(i32 46, float %34, float %23, float %56) ; FMad(a,b,c) + %58 = call float @dx.op.tertiary.f32(i32 46, float %35, float %28, float %57) ; FMad(a,b,c) + %59 = fmul fast float %32, %14 + %60 = call float @dx.op.tertiary.f32(i32 46, float %33, float %19, float %59) ; FMad(a,b,c) + %61 = call float @dx.op.tertiary.f32(i32 46, float %34, float %24, float %60) ; FMad(a,b,c) + %62 = call float @dx.op.tertiary.f32(i32 46, float %35, float %29, float %61) ; FMad(a,b,c) + %63 = fmul fast float %32, %15 + %64 = call float @dx.op.tertiary.f32(i32 46, float %33, float %20, float %63) ; FMad(a,b,c) + %65 = call float @dx.op.tertiary.f32(i32 46, float %34, float %25, float %64) ; FMad(a,b,c) + %66 = call float @dx.op.tertiary.f32(i32 46, float %35, float %30, float %65) ; FMad(a,b,c) + %67 = fmul fast float %37, %12 + %68 = call float @dx.op.tertiary.f32(i32 46, float %38, float %17, float %67) ; FMad(a,b,c) + %69 = call float @dx.op.tertiary.f32(i32 46, float %39, float %22, float %68) ; FMad(a,b,c) + %70 = call float @dx.op.tertiary.f32(i32 46, float %40, float %27, float %69) ; FMad(a,b,c) + %71 = fmul fast float %37, %13 + %72 = call float @dx.op.tertiary.f32(i32 46, float %38, float %18, float %71) ; FMad(a,b,c) + %73 = call float @dx.op.tertiary.f32(i32 46, float %39, float %23, float %72) ; FMad(a,b,c) + %74 = call float @dx.op.tertiary.f32(i32 46, float %40, float %28, float %73) ; FMad(a,b,c) + %75 = fmul fast float %37, %14 + %76 = call float @dx.op.tertiary.f32(i32 46, float %38, float %19, float %75) ; FMad(a,b,c) + %77 = call float @dx.op.tertiary.f32(i32 46, float %39, float %24, float %76) ; FMad(a,b,c) + %78 = call float @dx.op.tertiary.f32(i32 46, float %40, float %29, float %77) ; FMad(a,b,c) + %79 = fmul fast float %37, %15 + %80 = call float @dx.op.tertiary.f32(i32 46, float %38, float %20, float %79) ; FMad(a,b,c) + %81 = call float @dx.op.tertiary.f32(i32 46, float %39, float %25, float %80) ; FMad(a,b,c) + %82 = call float @dx.op.tertiary.f32(i32 46, float %40, float %30, float %81) ; FMad(a,b,c) + %83 = fmul fast float %42, %12 + %84 = call float @dx.op.tertiary.f32(i32 46, float %43, float %17, float %83) ; FMad(a,b,c) + %85 = call float @dx.op.tertiary.f32(i32 46, float %44, float %22, float %84) ; FMad(a,b,c) + %86 = call float @dx.op.tertiary.f32(i32 46, float %45, float %27, float %85) ; FMad(a,b,c) + %87 = fmul fast float %42, %13 + %88 = call float @dx.op.tertiary.f32(i32 46, float %43, float %18, float %87) ; FMad(a,b,c) + %89 = call float @dx.op.tertiary.f32(i32 46, float %44, float %23, float %88) ; FMad(a,b,c) + %90 = call float @dx.op.tertiary.f32(i32 46, float %45, float %28, float %89) ; FMad(a,b,c) + %91 = fmul fast float %42, %14 + %92 = call float @dx.op.tertiary.f32(i32 46, float %43, float %19, float %91) ; FMad(a,b,c) + %93 = call float @dx.op.tertiary.f32(i32 46, float %44, float %24, float %92) ; FMad(a,b,c) + %94 = call float @dx.op.tertiary.f32(i32 46, float %45, float %29, float %93) ; FMad(a,b,c) + %95 = fmul fast float %42, %15 + %96 = call float @dx.op.tertiary.f32(i32 46, float %43, float %20, float %95) ; FMad(a,b,c) + %97 = call float @dx.op.tertiary.f32(i32 46, float %44, float %25, float %96) ; FMad(a,b,c) + %98 = call float @dx.op.tertiary.f32(i32 46, float %45, float %30, float %97) ; FMad(a,b,c) + %99 = fmul fast float %47, %12 + %100 = call float @dx.op.tertiary.f32(i32 46, float %48, float %17, float %99) ; FMad(a,b,c) + %101 = call float @dx.op.tertiary.f32(i32 46, float %49, float %22, float %100) ; FMad(a,b,c) + %102 = call float @dx.op.tertiary.f32(i32 46, float %50, float %27, float %101) ; FMad(a,b,c) + %103 = fmul fast float %47, %13 + %104 = call float @dx.op.tertiary.f32(i32 46, float %48, float %18, float %103) ; FMad(a,b,c) + %105 = call float @dx.op.tertiary.f32(i32 46, float %49, float %23, float %104) ; FMad(a,b,c) + %106 = call float @dx.op.tertiary.f32(i32 46, float %50, float %28, float %105) ; FMad(a,b,c) + %107 = fmul fast float %47, %14 + %108 = call float @dx.op.tertiary.f32(i32 46, float %48, float %19, float %107) ; FMad(a,b,c) + %109 = call float @dx.op.tertiary.f32(i32 46, float %49, float %24, float %108) ; FMad(a,b,c) + %110 = call float @dx.op.tertiary.f32(i32 46, float %50, float %29, float %109) ; FMad(a,b,c) + %111 = fmul fast float %47, %15 + %112 = call float @dx.op.tertiary.f32(i32 46, float %48, float %20, float %111) ; FMad(a,b,c) + %113 = call float @dx.op.tertiary.f32(i32 46, float %49, float %25, float %112) ; FMad(a,b,c) + %114 = call float @dx.op.tertiary.f32(i32 46, float %50, float %30, float %113) ; FMad(a,b,c) + %115 = fmul fast float %54, %8 + %116 = call float @dx.op.tertiary.f32(i32 46, float %9, float %70, float %115) ; FMad(a,b,c) + %117 = call float @dx.op.tertiary.f32(i32 46, float %10, float %86, float %116) ; FMad(a,b,c) + %118 = fadd fast float %117, %102 + %119 = fmul fast float %58, %8 + %120 = call float @dx.op.tertiary.f32(i32 46, float %9, float %74, float %119) ; FMad(a,b,c) + %121 = call float @dx.op.tertiary.f32(i32 46, float %10, float %90, float %120) ; FMad(a,b,c) + %122 = fadd fast float %121, %106 + %123 = fmul fast float %62, %8 + %124 = call float @dx.op.tertiary.f32(i32 46, float %9, float %78, float %123) ; FMad(a,b,c) + %125 = call float @dx.op.tertiary.f32(i32 46, float %10, float %94, float %124) ; FMad(a,b,c) + %126 = fadd fast float %125, %110 + %127 = fmul fast float %66, %8 + %128 = call float @dx.op.tertiary.f32(i32 46, float %9, float %82, float %127) ; FMad(a,b,c) + %129 = call float @dx.op.tertiary.f32(i32 46, float %10, float %98, float %128) ; FMad(a,b,c) + %130 = fadd fast float %129, %114 + call void @dx.op.storeOutput.f32(i32 5, i32 0, i32 0, i8 0, float %4) ; StoreOutput(outputSigId,rowIndex,colIndex,value) + call void @dx.op.storeOutput.f32(i32 5, i32 0, i32 0, i8 1, float %5) ; StoreOutput(outputSigId,rowIndex,colIndex,value) + call void @dx.op.storeOutput.f32(i32 5, i32 0, i32 0, i8 2, float %6) ; StoreOutput(outputSigId,rowIndex,colIndex,value) + call void @dx.op.storeOutput.f32(i32 5, i32 0, i32 0, i8 3, float %7) ; StoreOutput(outputSigId,rowIndex,colIndex,value) + call void @dx.op.storeOutput.f32(i32 5, i32 1, i32 0, i8 0, float %2) ; StoreOutput(outputSigId,rowIndex,colIndex,value) + call void @dx.op.storeOutput.f32(i32 5, i32 1, i32 0, i8 1, float %3) ; StoreOutput(outputSigId,rowIndex,colIndex,value) + call void @dx.op.storeOutput.f32(i32 5, i32 2, i32 0, i8 0, float %118) ; StoreOutput(outputSigId,rowIndex,colIndex,value) + call void @dx.op.storeOutput.f32(i32 5, i32 2, i32 0, i8 1, float %122) ; StoreOutput(outputSigId,rowIndex,colIndex,value) + call void @dx.op.storeOutput.f32(i32 5, i32 2, i32 0, i8 2, float %126) ; StoreOutput(outputSigId,rowIndex,colIndex,value) + call void @dx.op.storeOutput.f32(i32 5, i32 2, i32 0, i8 3, float %130) ; StoreOutput(outputSigId,rowIndex,colIndex,value) + ret void +} + +; Function Attrs: nounwind readnone +declare float @dx.op.loadInput.f32(i32, i32, i32, i8, i32) #0 + +; Function Attrs: nounwind +declare void @dx.op.storeOutput.f32(i32, i32, i32, i8, float) #1 + +; Function Attrs: nounwind readonly +declare %dx.types.CBufRet.f32 @dx.op.cbufferLoadLegacy.f32(i32, %dx.types.Handle, i32) #2 + +; Function Attrs: nounwind readnone +declare float @dx.op.tertiary.f32(i32, float, float, float) #0 + +; Function Attrs: nounwind readonly +declare %dx.types.Handle @dx.op.createHandle(i32, i8, i32, i32, i1) #2 + +attributes #0 = { nounwind readnone } +attributes #1 = { nounwind } +attributes #2 = { nounwind readonly } + +!llvm.ident = !{!0} +!dx.version = !{!1} +!dx.valver = !{!2} +!dx.shaderModel = !{!3} +!dx.resources = !{!4} +!dx.viewIdState = !{!7} +!dx.entryPoints = !{!8} + +!0 = !{!"dxc(private) 1.8.0.4662 (416fab6b5)"} +!1 = !{i32 1, i32 0} +!2 = !{i32 1, i32 8} +!3 = !{!"vs", i32 6, i32 0} +!4 = !{null, null, !5, null} +!5 = !{!6} +!6 = !{i32 0, %hostlayout._28_30* undef, !"", i32 1, i32 0, i32 1, i32 128, null} +!7 = !{[12 x i32] [i32 10, i32 12, i32 3840, i32 3840, i32 3840, i32 0, i32 1, i32 2, i32 4, i32 8, i32 16, i32 32]} +!8 = !{void ()* @main, !"main", !9, !4, null} +!9 = !{!10, !20, null} +!10 = !{!11, !14, !17} +!11 = !{i32 0, !"TEXCOORD", i8 9, i8 0, !12, i8 0, i32 1, i8 3, i32 0, i8 0, !13} +!12 = !{i32 0} +!13 = !{i32 3, i32 7} +!14 = !{i32 1, !"TEXCOORD", i8 9, i8 0, !15, i8 0, i32 1, i8 4, i32 1, i8 0, !16} +!15 = !{i32 1} +!16 = !{i32 3, i32 15} +!17 = !{i32 2, !"TEXCOORD", i8 9, i8 0, !18, i8 0, i32 1, i8 2, i32 2, i8 0, !19} +!18 = !{i32 2} +!19 = !{i32 3, i32 3} +!20 = !{!21, !22, !23} +!21 = !{i32 0, !"TEXCOORD", i8 9, i8 0, !12, i8 2, i32 1, i8 4, i32 0, i8 0, !16} +!22 = !{i32 1, !"TEXCOORD", i8 9, i8 0, !15, i8 2, i32 1, i8 2, i32 1, i8 0, !19} +!23 = !{i32 2, !"SV_Position", i8 9, i8 3, !12, i8 4, i32 1, i8 4, i32 2, i8 0, !16} + +#endif + +static const unsigned char shader_vert_sm60_dxil[] = { + 0x44, 0x58, 0x42, 0x43, 0x75, 0x2a, 0x09, 0xa8, 0x0e, 0xa0, 0xfc, 0x84, + 0x6f, 0x71, 0x6c, 0xb5, 0x3c, 0x0d, 0x99, 0x02, 0x01, 0x00, 0x00, 0x00, + 0x50, 0x14, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, + 0x4c, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, 0x50, 0x01, 0x00, 0x00, + 0x8c, 0x02, 0x00, 0x00, 0x08, 0x09, 0x00, 0x00, 0x24, 0x09, 0x00, 0x00, + 0x53, 0x46, 0x49, 0x30, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x31, 0x74, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 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, + 0x80, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x68, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x0c, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x71, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0x53, 0x56, 0x5f, + 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x00, 0x00, 0x00, + 0x50, 0x53, 0x56, 0x30, 0x34, 0x01, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, + 0x01, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x03, 0x03, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x2e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x34, 0x00, 0x00, 0x00, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, + 0x44, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0x54, + 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0x54, 0x45, 0x58, 0x43, + 0x4f, 0x4f, 0x52, 0x44, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, + 0x44, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x43, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x44, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x13, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x02, 0x42, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x44, 0x00, 0x03, 0x02, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x42, 0x00, 0x03, 0x02, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x44, 0x03, + 0x03, 0x04, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, + 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x53, 0x54, 0x41, 0x54, 0x74, 0x06, 0x00, 0x00, + 0x60, 0x00, 0x01, 0x00, 0x9d, 0x01, 0x00, 0x00, 0x44, 0x58, 0x49, 0x4c, + 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x5c, 0x06, 0x00, 0x00, + 0x42, 0x43, 0xc0, 0xde, 0x21, 0x0c, 0x00, 0x00, 0x94, 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, 0x23, 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, 0xa3, 0x86, 0xcb, 0x9f, + 0xb0, 0x87, 0x90, 0x7c, 0x6e, 0xa3, 0x8a, 0x95, 0x98, 0xfc, 0xe2, 0xb6, + 0x11, 0x31, 0xc6, 0x18, 0x54, 0xee, 0x19, 0x2e, 0x7f, 0xc2, 0x1e, 0x42, + 0xf2, 0x43, 0xa0, 0x19, 0x16, 0x02, 0x05, 0xab, 0x10, 0x8a, 0x30, 0x42, + 0xad, 0x14, 0x83, 0x8c, 0x31, 0xe8, 0xcd, 0x11, 0x04, 0xc5, 0x60, 0xa4, + 0x10, 0x12, 0x49, 0x0e, 0x04, 0x0c, 0x23, 0x10, 0x43, 0x12, 0xd4, 0x8b, + 0x0e, 0x47, 0x9a, 0x16, 0x00, 0x73, 0xa8, 0xc9, 0xff, 0x6d, 0xfe, 0xbf, + 0x69, 0x24, 0x58, 0x4b, 0x37, 0x19, 0x08, 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, 0x23, 0x01, 0x01, + 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x16, 0x08, 0x00, + 0x14, 0x00, 0x00, 0x00, 0x32, 0x1e, 0x98, 0x14, 0x19, 0x11, 0x4c, 0x90, + 0x8c, 0x09, 0x26, 0x47, 0xc6, 0x04, 0x43, 0x22, 0x25, 0x30, 0x02, 0x50, + 0x0c, 0x05, 0x28, 0x50, 0x04, 0x85, 0x50, 0x06, 0xe5, 0x50, 0x12, 0x05, + 0x18, 0x50, 0x1e, 0x05, 0x53, 0x9a, 0x02, 0x45, 0x41, 0xa5, 0x24, 0x46, + 0x00, 0xca, 0xa0, 0x10, 0x8a, 0x80, 0x62, 0x0d, 0xd0, 0x9d, 0x01, 0x20, + 0x3c, 0x03, 0x40, 0x79, 0x2c, 0x46, 0x61, 0x40, 0x7c, 0x00, 0xf1, 0x01, + 0xc4, 0x07, 0x20, 0x10, 0x08, 0x04, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x79, 0x18, 0x00, 0x00, 0x93, 0x00, 0x00, 0x00, 0x1a, 0x03, 0x4c, 0x90, + 0x46, 0x02, 0x13, 0xc4, 0x31, 0x20, 0xc3, 0x1b, 0x43, 0x81, 0x93, 0x4b, + 0xb3, 0x0b, 0xa3, 0x2b, 0x4b, 0x01, 0x89, 0x71, 0xc1, 0x71, 0x81, 0x71, + 0xa1, 0xb1, 0xb1, 0x91, 0x01, 0x41, 0xa1, 0x89, 0xb1, 0x31, 0x0b, 0x13, + 0xb3, 0x11, 0xab, 0x49, 0xd9, 0x10, 0x04, 0x13, 0x04, 0xc2, 0x98, 0x20, + 0x10, 0xc7, 0x06, 0x61, 0x20, 0x36, 0x08, 0x04, 0x41, 0xc1, 0x6e, 0x6e, + 0x82, 0x40, 0x20, 0x1b, 0x86, 0x03, 0x21, 0x26, 0x08, 0xd8, 0x46, 0xe3, + 0x4b, 0x06, 0xe7, 0x6b, 0x06, 0x66, 0x82, 0x40, 0x24, 0x1b, 0x10, 0x42, + 0x59, 0x06, 0x62, 0x60, 0x80, 0x0d, 0x41, 0xb3, 0x81, 0x00, 0x00, 0x07, + 0x98, 0x20, 0x5c, 0x1a, 0x8d, 0xaf, 0x19, 0x98, 0xaf, 0x36, 0x98, 0x09, + 0x02, 0xa1, 0x4c, 0x10, 0x88, 0x65, 0xc3, 0x30, 0x4d, 0xc3, 0x04, 0x81, + 0x60, 0x26, 0x08, 0x44, 0x33, 0x41, 0x20, 0x9c, 0x09, 0x42, 0x94, 0x6d, + 0x50, 0x90, 0x48, 0xa2, 0x2a, 0xc2, 0xba, 0x2e, 0x8c, 0xc6, 0xd7, 0x0c, + 0xcc, 0x57, 0x5b, 0xcc, 0x04, 0x81, 0x78, 0x36, 0x28, 0x88, 0x26, 0x51, + 0xd5, 0x66, 0x5d, 0x17, 0xb6, 0x61, 0x60, 0x32, 0x6e, 0xc3, 0x40, 0x40, + 0xdd, 0x04, 0x41, 0x00, 0x36, 0x00, 0x1b, 0x06, 0x02, 0x0c, 0xc0, 0x60, + 0x43, 0x10, 0x06, 0x1b, 0x86, 0xe1, 0x13, 0x83, 0x09, 0x42, 0xc6, 0x6d, + 0x08, 0xc8, 0x80, 0x44, 0x5b, 0x58, 0x9a, 0x1b, 0x11, 0xaa, 0x22, 0xac, + 0xa1, 0xa7, 0x27, 0x29, 0xa2, 0x09, 0x42, 0x41, 0x4d, 0x10, 0x8a, 0x6a, + 0x43, 0x40, 0x4c, 0x10, 0x0a, 0x6b, 0x83, 0x50, 0x59, 0x1b, 0x16, 0xe2, + 0x0c, 0xd0, 0x20, 0x0d, 0xd4, 0x20, 0x0d, 0x86, 0x35, 0x20, 0xd2, 0x80, + 0x0d, 0x36, 0x04, 0xc3, 0x04, 0xa1, 0xb8, 0x26, 0x08, 0x04, 0xb4, 0x41, + 0xa8, 0xe0, 0x60, 0xc3, 0x32, 0x9c, 0x01, 0x1a, 0xa4, 0x81, 0x1b, 0xa4, + 0xc1, 0xf0, 0x06, 0x43, 0x1a, 0xc4, 0xc1, 0x86, 0x40, 0x9a, 0x20, 0x14, + 0xd8, 0x06, 0xa1, 0xaa, 0x36, 0x2c, 0xd2, 0x19, 0xa0, 0x41, 0x1a, 0xcc, + 0x41, 0x1a, 0x0c, 0x74, 0x20, 0xa5, 0x41, 0x1d, 0x6c, 0x18, 0xda, 0x40, + 0x0e, 0xec, 0x60, 0xc3, 0x42, 0x9c, 0x01, 0x1a, 0xa4, 0x81, 0x1a, 0xd0, + 0xc1, 0xf0, 0x06, 0x44, 0x1a, 0xc4, 0xc1, 0x86, 0x65, 0x38, 0x03, 0x34, + 0x48, 0x03, 0x37, 0xa0, 0x83, 0x81, 0x0e, 0x86, 0x34, 0xa8, 0x03, 0x2e, + 0x53, 0x56, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x1b, + 0x16, 0x49, 0x0f, 0xd0, 0x60, 0x0d, 0xd4, 0xe0, 0x0d, 0x86, 0x37, 0x90, + 0xd2, 0x20, 0x0e, 0x36, 0x0c, 0x78, 0x90, 0x07, 0x7b, 0xb0, 0x61, 0xb8, + 0x03, 0x3e, 0x00, 0x36, 0x14, 0x9f, 0x19, 0xf4, 0xc1, 0x03, 0xd0, 0x30, + 0x63, 0x7b, 0x0b, 0xa3, 0x9b, 0x9b, 0x20, 0x10, 0x11, 0x8b, 0x34, 0xb7, + 0x39, 0xba, 0xb9, 0x09, 0x02, 0x21, 0xd1, 0x98, 0x4b, 0x3b, 0xfb, 0x62, + 0x23, 0xa3, 0x31, 0x97, 0x76, 0xf6, 0x35, 0x47, 0x37, 0x41, 0x20, 0xa6, + 0x0d, 0xc8, 0x1f, 0x80, 0x42, 0x28, 0x88, 0xc2, 0x28, 0x5c, 0xa4, 0x50, + 0x0a, 0x55, 0xd8, 0xd8, 0xec, 0xda, 0x5c, 0xd2, 0xc8, 0xca, 0xdc, 0xe8, + 0xa6, 0x04, 0x41, 0x15, 0x32, 0x3c, 0x17, 0xbb, 0x32, 0xb9, 0xb9, 0xb4, + 0x37, 0xb7, 0x29, 0x01, 0xd1, 0x84, 0x0c, 0xcf, 0xc5, 0x2e, 0x8c, 0xcd, + 0xae, 0x4c, 0x6e, 0x4a, 0x50, 0xd4, 0x21, 0xc3, 0x73, 0x99, 0x43, 0x0b, + 0x23, 0x2b, 0x93, 0x6b, 0x7a, 0x23, 0x2b, 0x63, 0x9b, 0x12, 0x20, 0x65, + 0xc8, 0xf0, 0x5c, 0xe4, 0xca, 0xe6, 0xde, 0xea, 0xe4, 0xc6, 0xca, 0xe6, + 0xa6, 0x04, 0x4e, 0x25, 0x32, 0x3c, 0x17, 0xba, 0x3c, 0xb8, 0xb2, 0x20, + 0x37, 0xb7, 0x37, 0xba, 0x30, 0xba, 0xb4, 0x37, 0xb7, 0xb9, 0x29, 0x42, + 0x27, 0x06, 0x75, 0xc8, 0xf0, 0x5c, 0xec, 0xd2, 0xca, 0xee, 0x92, 0xc8, + 0xa6, 0xe8, 0xc2, 0xe8, 0xca, 0xa6, 0x04, 0x64, 0x50, 0x87, 0x0c, 0xcf, + 0xa5, 0xcc, 0x8d, 0x4e, 0x2e, 0x0f, 0xea, 0x2d, 0xcd, 0x8d, 0x6e, 0x6e, + 0x4a, 0xd0, 0x07, 0x5d, 0xc8, 0xf0, 0x5c, 0xc6, 0xde, 0xea, 0xdc, 0xe8, + 0xca, 0xe4, 0xe6, 0xa6, 0x04, 0xa5, 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, + 0x18, 0x00, 0x00, 0x00, 0x36, 0xb0, 0x0d, 0x97, 0xef, 0x3c, 0xbe, 0x10, + 0x50, 0x45, 0x41, 0x44, 0xa5, 0x03, 0x0c, 0x25, 0x61, 0x00, 0x02, 0xe6, + 0x17, 0xb7, 0x6d, 0x05, 0xd2, 0x70, 0xf9, 0xce, 0xe3, 0x0b, 0x11, 0x01, + 0x4c, 0x44, 0x08, 0x34, 0xc3, 0x42, 0x58, 0xc0, 0x34, 0x5c, 0xbe, 0xf3, + 0xf8, 0x8b, 0x03, 0x0c, 0x62, 0xf3, 0x50, 0x93, 0x5f, 0xdc, 0xb6, 0x09, + 0x54, 0xc3, 0xe5, 0x3b, 0x8f, 0x2f, 0x4d, 0x4e, 0x44, 0xa0, 0xd4, 0xf4, + 0x50, 0x93, 0x5f, 0xdc, 0xb6, 0x11, 0x48, 0xc3, 0xe5, 0x3b, 0x8f, 0x3f, + 0x11, 0xd1, 0x84, 0x00, 0x11, 0xe6, 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, 0x30, 0x9f, 0xf3, 0xc5, + 0x35, 0xc3, 0xf7, 0x8f, 0x8c, 0xbd, 0x63, 0xfc, 0x70, 0x61, 0x3d, 0x2f, + 0x44, 0x58, 0x49, 0x4c, 0x24, 0x0b, 0x00, 0x00, 0x60, 0x00, 0x01, 0x00, + 0xc9, 0x02, 0x00, 0x00, 0x44, 0x58, 0x49, 0x4c, 0x00, 0x01, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x0c, 0x0b, 0x00, 0x00, 0x42, 0x43, 0xc0, 0xde, + 0x21, 0x0c, 0x00, 0x00, 0xc0, 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, 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, 0x23, 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, 0xa3, 0x86, 0xcb, 0x9f, 0xb0, 0x87, 0x90, 0x7c, + 0x6e, 0xa3, 0x8a, 0x95, 0x98, 0xfc, 0xe2, 0xb6, 0x11, 0x31, 0xc6, 0x18, + 0x54, 0xee, 0x19, 0x2e, 0x7f, 0xc2, 0x1e, 0x42, 0xf2, 0x43, 0xa0, 0x19, + 0x16, 0x02, 0x05, 0xab, 0x10, 0x8a, 0x30, 0x42, 0xad, 0x14, 0x83, 0x8c, + 0x31, 0xe8, 0xcd, 0x11, 0x04, 0xc5, 0x60, 0xa4, 0x10, 0x12, 0x49, 0x0e, + 0x04, 0x0c, 0x23, 0x10, 0x43, 0x12, 0xd4, 0x8b, 0x0e, 0x47, 0x9a, 0x16, + 0x00, 0x73, 0xa8, 0xc9, 0xff, 0x6d, 0xfe, 0xbf, 0x69, 0x24, 0x58, 0x4b, + 0x37, 0x19, 0x08, 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, 0x23, 0x01, 0x01, 0x30, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x40, 0x16, 0x08, 0x00, 0x10, 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, 0x80, + 0x02, 0x65, 0x50, 0x0e, 0xe5, 0x51, 0x04, 0x54, 0x4a, 0x62, 0x04, 0xa0, + 0x0c, 0x0a, 0xa1, 0x08, 0x08, 0xcf, 0x00, 0x50, 0x1e, 0x8b, 0x51, 0x18, + 0x10, 0x1f, 0x40, 0x7c, 0x00, 0xf1, 0x01, 0x08, 0x04, 0x02, 0x81, 0xc0, + 0x00, 0x00, 0x00, 0x00, 0x79, 0x18, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, + 0x1a, 0x03, 0x4c, 0x90, 0x46, 0x02, 0x13, 0xc4, 0x31, 0x20, 0xc3, 0x1b, + 0x43, 0x81, 0x93, 0x4b, 0xb3, 0x0b, 0xa3, 0x2b, 0x4b, 0x01, 0x89, 0x71, + 0xc1, 0x71, 0x81, 0x71, 0xa1, 0xb1, 0xb1, 0x91, 0x01, 0x41, 0xa1, 0x89, + 0xb1, 0x31, 0x0b, 0x13, 0xb3, 0x11, 0xab, 0x49, 0xd9, 0x10, 0x04, 0x13, + 0x04, 0xc2, 0x98, 0x20, 0x10, 0xc7, 0x06, 0x61, 0x20, 0x26, 0x08, 0x04, + 0xb2, 0x41, 0x18, 0x0c, 0x0a, 0x76, 0x73, 0x13, 0x04, 0x22, 0xd9, 0x30, + 0x20, 0x09, 0x31, 0x41, 0xc0, 0x28, 0x02, 0x13, 0x04, 0x42, 0xd9, 0x80, + 0x10, 0x0b, 0x33, 0x10, 0x43, 0x03, 0x6c, 0x08, 0x9c, 0x0d, 0x04, 0x00, + 0x3c, 0xc0, 0x04, 0x21, 0xab, 0x36, 0x04, 0xd1, 0x04, 0x41, 0x00, 0x48, + 0xb4, 0x85, 0xa5, 0xb9, 0x11, 0xa1, 0x2a, 0xc2, 0x1a, 0x7a, 0x7a, 0x92, + 0x22, 0x9a, 0x20, 0x14, 0xcf, 0x04, 0xa1, 0x80, 0x36, 0x04, 0xc4, 0x04, + 0xa1, 0x88, 0x26, 0x08, 0xc4, 0x32, 0x41, 0x20, 0x98, 0x0d, 0x82, 0xb6, + 0x6d, 0x58, 0x88, 0xca, 0xba, 0xb0, 0x6b, 0xc8, 0x88, 0x8b, 0xdb, 0x10, + 0x0c, 0x13, 0x84, 0x42, 0x9a, 0x20, 0x10, 0xcd, 0x06, 0x41, 0x03, 0x83, + 0x0d, 0xcb, 0x50, 0x59, 0x97, 0x77, 0x0d, 0xdf, 0x70, 0x85, 0xc1, 0x04, + 0x81, 0x70, 0x36, 0x04, 0x63, 0x30, 0x41, 0x28, 0xa6, 0x0d, 0x82, 0xa6, + 0x6d, 0x58, 0xc6, 0xa0, 0xb2, 0x2e, 0x32, 0xb8, 0x86, 0x32, 0x18, 0x83, + 0xcb, 0x0c, 0x36, 0x0c, 0x9d, 0x18, 0x9c, 0xc1, 0x86, 0x85, 0xa8, 0xac, + 0x0b, 0x2b, 0x83, 0xe1, 0x23, 0xae, 0x30, 0xd8, 0xb0, 0x0c, 0x95, 0x75, + 0x79, 0x65, 0x30, 0x94, 0xc1, 0x70, 0x99, 0x01, 0x97, 0x29, 0xab, 0x2f, + 0xa8, 0xb7, 0xb9, 0x34, 0xba, 0xb4, 0x37, 0xb7, 0x0d, 0xcb, 0x18, 0xac, + 0x81, 0x95, 0x61, 0xdf, 0xf0, 0x8d, 0xc1, 0x15, 0x06, 0x1b, 0x86, 0x34, + 0x50, 0x03, 0x36, 0xd8, 0x30, 0xa0, 0x41, 0x1b, 0x00, 0x1b, 0x8a, 0x89, + 0x72, 0x03, 0x08, 0xa8, 0xc2, 0xc6, 0x66, 0xd7, 0xe6, 0x92, 0x46, 0x56, + 0xe6, 0x46, 0x37, 0x25, 0x08, 0xaa, 0x90, 0xe1, 0xb9, 0xd8, 0x95, 0xc9, + 0xcd, 0xa5, 0xbd, 0xb9, 0x4d, 0x09, 0x88, 0x26, 0x64, 0x78, 0x2e, 0x76, + 0x61, 0x6c, 0x76, 0x65, 0x72, 0x53, 0x02, 0xa3, 0x0e, 0x19, 0x9e, 0xcb, + 0x1c, 0x5a, 0x18, 0x59, 0x99, 0x5c, 0xd3, 0x1b, 0x59, 0x19, 0xdb, 0x94, + 0x20, 0x29, 0x43, 0x86, 0xe7, 0x22, 0x57, 0x36, 0xf7, 0x56, 0x27, 0x37, + 0x56, 0x36, 0x37, 0x25, 0x78, 0xea, 0x90, 0xe1, 0xb9, 0xd8, 0xa5, 0x95, + 0xdd, 0x25, 0x91, 0x4d, 0xd1, 0x85, 0xd1, 0x95, 0x4d, 0x09, 0xa2, 0x3a, + 0x64, 0x78, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, + 0x74, 0x73, 0x53, 0x02, 0x37, 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, + 0x18, 0x00, 0x00, 0x00, 0x36, 0xb0, 0x0d, 0x97, 0xef, 0x3c, 0xbe, 0x10, + 0x50, 0x45, 0x41, 0x44, 0xa5, 0x03, 0x0c, 0x25, 0x61, 0x00, 0x02, 0xe6, + 0x17, 0xb7, 0x6d, 0x05, 0xd2, 0x70, 0xf9, 0xce, 0xe3, 0x0b, 0x11, 0x01, + 0x4c, 0x44, 0x08, 0x34, 0xc3, 0x42, 0x58, 0xc0, 0x34, 0x5c, 0xbe, 0xf3, + 0xf8, 0x8b, 0x03, 0x0c, 0x62, 0xf3, 0x50, 0x93, 0x5f, 0xdc, 0xb6, 0x09, + 0x54, 0xc3, 0xe5, 0x3b, 0x8f, 0x2f, 0x4d, 0x4e, 0x44, 0xa0, 0xd4, 0xf4, + 0x50, 0x93, 0x5f, 0xdc, 0xb6, 0x11, 0x48, 0xc3, 0xe5, 0x3b, 0x8f, 0x3f, + 0x11, 0xd1, 0x84, 0x00, 0x11, 0xe6, 0x17, 0xb7, 0x6d, 0x00, 0x04, 0x03, + 0x20, 0x0d, 0x00, 0x00, 0x61, 0x20, 0x00, 0x00, 0x5f, 0x01, 0x00, 0x00, + 0x13, 0x04, 0x41, 0x2c, 0x10, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, + 0x44, 0x8a, 0xab, 0x14, 0x0a, 0x61, 0x06, 0xa0, 0xec, 0x4a, 0x8e, 0x4a, + 0x09, 0x50, 0x1c, 0x01, 0x00, 0x00, 0x00, 0x00, 0x23, 0x06, 0x09, 0x00, + 0x82, 0x60, 0x20, 0x65, 0xc3, 0x72, 0x5d, 0xc1, 0x88, 0x41, 0x02, 0x80, + 0x20, 0x18, 0x18, 0xde, 0x11, 0x61, 0x8f, 0x31, 0x62, 0x90, 0x00, 0x20, + 0x08, 0x06, 0xc6, 0x87, 0x48, 0x19, 0x71, 0x8c, 0x18, 0x24, 0x00, 0x08, + 0x82, 0x81, 0x01, 0x06, 0xc9, 0xa6, 0x45, 0xc8, 0x88, 0x41, 0x02, 0x80, + 0x20, 0x18, 0x18, 0x61, 0xa0, 0x70, 0x9b, 0x91, 0x8c, 0x18, 0x24, 0x00, + 0x08, 0x82, 0x81, 0x21, 0x06, 0x4b, 0xc7, 0x41, 0xca, 0x88, 0x41, 0x02, + 0x80, 0x20, 0x18, 0x18, 0x63, 0xc0, 0x78, 0xdd, 0xb4, 0x8c, 0x18, 0x24, + 0x00, 0x08, 0x82, 0x81, 0x41, 0x06, 0x8d, 0xe7, 0x55, 0xcc, 0x88, 0x41, + 0x02, 0x80, 0x20, 0x18, 0x18, 0x65, 0xe0, 0x7c, 0x9f, 0xd2, 0x8c, 0x18, + 0x24, 0x00, 0x08, 0x82, 0x81, 0x61, 0x06, 0x0f, 0x18, 0x80, 0x01, 0xe5, + 0x8c, 0x18, 0x1c, 0x00, 0x08, 0x82, 0x41, 0x53, 0x06, 0x8e, 0x12, 0x06, + 0xa3, 0x09, 0x01, 0x30, 0x9a, 0x20, 0x04, 0xa3, 0x09, 0x83, 0x30, 0x9a, + 0x40, 0x0c, 0x23, 0x06, 0x07, 0x00, 0x82, 0x60, 0xd0, 0xa8, 0xc1, 0xf4, + 0x9c, 0xc1, 0x68, 0x42, 0x00, 0x8c, 0x26, 0x08, 0xc1, 0x68, 0xc2, 0x20, + 0x8c, 0x26, 0x10, 0xc3, 0x88, 0xc1, 0x01, 0x80, 0x20, 0x18, 0x34, 0x6f, + 0x80, 0x51, 0x64, 0x30, 0x9a, 0x10, 0x00, 0xa3, 0x09, 0x42, 0x30, 0x9a, + 0x30, 0x08, 0xa3, 0x09, 0xc4, 0x30, 0x62, 0x70, 0x00, 0x20, 0x08, 0x06, + 0x0d, 0x1d, 0x74, 0x19, 0x1b, 0x8c, 0x26, 0x04, 0xc0, 0x68, 0x82, 0x10, + 0x8c, 0x26, 0x0c, 0xc2, 0x68, 0x02, 0x31, 0x8c, 0x18, 0x1c, 0x00, 0x08, + 0x82, 0x41, 0x93, 0x07, 0x62, 0xe0, 0x91, 0xc1, 0x68, 0x42, 0x00, 0x8c, + 0x26, 0x08, 0xc1, 0x68, 0xc2, 0x20, 0x8c, 0x26, 0x10, 0xc3, 0x88, 0xc1, + 0x01, 0x80, 0x20, 0x18, 0x34, 0x7e, 0x70, 0x06, 0x63, 0xa0, 0x06, 0xa3, + 0x09, 0x01, 0x30, 0x9a, 0x20, 0x04, 0xa3, 0x09, 0x83, 0x30, 0x9a, 0x40, + 0x0c, 0x23, 0x06, 0x07, 0x00, 0x82, 0x60, 0xd0, 0x8c, 0x02, 0x1b, 0xa0, + 0x41, 0x1f, 0x8c, 0x26, 0x04, 0xc0, 0x68, 0x82, 0x10, 0x8c, 0x26, 0x0c, + 0xc2, 0x68, 0x02, 0x31, 0x8c, 0x18, 0x1c, 0x00, 0x08, 0x82, 0x41, 0x83, + 0x0a, 0x71, 0xd0, 0x06, 0x7f, 0x30, 0x9a, 0x10, 0x00, 0xa3, 0x09, 0x42, + 0x30, 0x9a, 0x30, 0x08, 0xa3, 0x09, 0xc4, 0x60, 0xd3, 0x19, 0xc8, 0x67, + 0xc4, 0x00, 0x01, 0x40, 0x10, 0x0c, 0x9e, 0x56, 0xd8, 0x83, 0x69, 0x0c, + 0x82, 0x11, 0x03, 0x04, 0x00, 0x41, 0x30, 0x78, 0x5c, 0x81, 0x0f, 0xa6, + 0x2f, 0x18, 0x31, 0x40, 0x00, 0x10, 0x04, 0x83, 0xe7, 0x15, 0xfa, 0x60, + 0xda, 0x02, 0xbb, 0xd4, 0x40, 0x3e, 0x23, 0x06, 0x08, 0x00, 0x82, 0x60, + 0xf0, 0xc4, 0xc2, 0x1f, 0x5c, 0x66, 0x10, 0x8c, 0x18, 0x20, 0x00, 0x08, + 0x82, 0xc1, 0x23, 0x0b, 0xa0, 0x70, 0x89, 0x41, 0x30, 0x62, 0x80, 0x00, + 0x20, 0x08, 0x06, 0xcf, 0x2c, 0x84, 0xc2, 0xe5, 0x05, 0xb6, 0xb5, 0x81, + 0x7c, 0x46, 0x0c, 0x10, 0x00, 0x04, 0xc1, 0xe0, 0xa9, 0x85, 0x51, 0xd8, + 0xd2, 0x20, 0x18, 0x31, 0x40, 0x00, 0x10, 0x04, 0x83, 0xc7, 0x16, 0x48, + 0x61, 0x2b, 0x83, 0x60, 0xc4, 0x00, 0x01, 0x40, 0x10, 0x0c, 0x9e, 0x5b, + 0x28, 0x85, 0x2d, 0x0c, 0x02, 0xfb, 0xe0, 0x40, 0x3e, 0x23, 0x06, 0x08, + 0x00, 0x82, 0x60, 0xf0, 0xe4, 0xc2, 0x29, 0x7c, 0x6c, 0x10, 0x8c, 0x18, + 0x20, 0x00, 0x08, 0x82, 0xc1, 0xa3, 0x0b, 0xa8, 0xf0, 0xa1, 0x41, 0x30, + 0x62, 0x80, 0x00, 0x20, 0x08, 0x06, 0xcf, 0x2e, 0xa4, 0xc2, 0x47, 0x06, + 0x81, 0x79, 0x77, 0x20, 0x9f, 0x11, 0x03, 0x04, 0x00, 0x41, 0x30, 0x78, + 0x7a, 0x61, 0x15, 0xbc, 0x39, 0x08, 0x46, 0x0c, 0x10, 0x00, 0x04, 0xc1, + 0xe0, 0xf1, 0x05, 0x56, 0xf0, 0xde, 0x20, 0x18, 0x31, 0x40, 0x00, 0x10, + 0x04, 0x83, 0xe7, 0x17, 0x5a, 0xc1, 0x5b, 0x83, 0xc0, 0xc4, 0x40, 0x0f, + 0xe4, 0x33, 0x62, 0x80, 0x00, 0x20, 0x08, 0x06, 0x4f, 0x38, 0xbc, 0x82, + 0x18, 0xd8, 0x41, 0x30, 0x62, 0x80, 0x00, 0x20, 0x08, 0x06, 0x8f, 0x38, + 0xc0, 0x82, 0x18, 0xc8, 0x41, 0x30, 0x62, 0x80, 0x00, 0x20, 0x08, 0x06, + 0xcf, 0x38, 0xc4, 0x82, 0x18, 0xb8, 0x41, 0x60, 0x66, 0xd0, 0x07, 0xf2, + 0x19, 0x31, 0x40, 0x00, 0x10, 0x04, 0x83, 0xa7, 0x1c, 0x66, 0xc1, 0x0c, + 0xf2, 0x20, 0x18, 0x31, 0x40, 0x00, 0x10, 0x04, 0x83, 0xc7, 0x1c, 0x68, + 0xc1, 0x0c, 0xea, 0x20, 0x18, 0x31, 0x40, 0x00, 0x10, 0x04, 0x83, 0xe7, + 0x1c, 0x6a, 0xc1, 0x0c, 0xe2, 0x20, 0x30, 0x35, 0x00, 0x05, 0xf9, 0x8c, + 0x18, 0x20, 0x00, 0x08, 0x82, 0xc1, 0x93, 0x0e, 0xb7, 0xa0, 0x06, 0x7c, + 0x10, 0x8c, 0x18, 0x20, 0x00, 0x08, 0x82, 0xc1, 0xa3, 0x0e, 0xb8, 0xa0, + 0x06, 0x78, 0x10, 0x8c, 0x18, 0x20, 0x00, 0x08, 0x82, 0xc1, 0xb3, 0x0e, + 0xb9, 0xa0, 0x06, 0x74, 0x10, 0x58, 0x1a, 0x9c, 0x82, 0x7c, 0x46, 0x0c, + 0x10, 0x00, 0x04, 0xc1, 0xe0, 0x69, 0x87, 0x5d, 0x48, 0x83, 0x51, 0x08, + 0x46, 0x0c, 0x10, 0x00, 0x04, 0xc1, 0xe0, 0x71, 0x07, 0x5e, 0x48, 0x83, + 0x3f, 0x08, 0x46, 0x0c, 0x10, 0x00, 0x04, 0xc1, 0xe0, 0x79, 0x87, 0x5e, + 0x48, 0x83, 0x3d, 0x08, 0xac, 0x0d, 0x54, 0x41, 0x3e, 0x23, 0x06, 0x08, + 0x00, 0x82, 0x60, 0xf0, 0xc4, 0xc3, 0x2f, 0xb4, 0x81, 0x29, 0x04, 0x23, + 0x06, 0x08, 0x00, 0x82, 0x60, 0xf0, 0xc8, 0x03, 0x38, 0xb4, 0x81, 0x28, + 0x04, 0x23, 0x06, 0x08, 0x00, 0x82, 0x60, 0xf0, 0xcc, 0x43, 0x38, 0xb4, + 0x81, 0x1f, 0x04, 0x16, 0x07, 0xad, 0x20, 0x9f, 0x11, 0x03, 0x04, 0x00, + 0x41, 0x30, 0x78, 0xea, 0x61, 0x1c, 0xe2, 0x20, 0x15, 0x82, 0x11, 0x03, + 0x04, 0x00, 0x41, 0x30, 0x78, 0xec, 0x81, 0x1c, 0xe2, 0xa0, 0x14, 0x82, + 0x11, 0x03, 0x04, 0x00, 0x41, 0x30, 0x78, 0xee, 0xa1, 0x1c, 0xe2, 0x20, + 0x14, 0x02, 0xab, 0x03, 0x58, 0x90, 0xcf, 0x88, 0x01, 0x02, 0x80, 0x20, + 0x18, 0x3c, 0xf9, 0x70, 0x0e, 0x75, 0xc0, 0x0a, 0xc1, 0x88, 0x01, 0x02, + 0x80, 0x20, 0x18, 0x3c, 0xfa, 0x80, 0x0e, 0x75, 0x80, 0x0a, 0xc1, 0x88, + 0x01, 0x02, 0x80, 0x20, 0x18, 0x3c, 0xfb, 0x90, 0x0e, 0x75, 0x40, 0x0a, + 0x81, 0xd1, 0xc1, 0x2d, 0xc8, 0x67, 0xc4, 0x00, 0x01, 0x40, 0x10, 0x0c, + 0x9e, 0x7e, 0x58, 0x07, 0x3a, 0x98, 0x85, 0x60, 0xc4, 0x00, 0x01, 0x40, + 0x10, 0x0c, 0x1e, 0x7f, 0x60, 0x07, 0x3a, 0x78, 0x85, 0x60, 0xc4, 0x00, + 0x01, 0x40, 0x10, 0x0c, 0x9e, 0x7f, 0x68, 0x07, 0x3a, 0x58, 0x85, 0xc0, + 0xf0, 0x40, 0x17, 0xe4, 0x33, 0x62, 0x80, 0x00, 0x20, 0x08, 0x06, 0x4f, + 0x48, 0xbc, 0x03, 0x1e, 0xd8, 0x42, 0x30, 0x62, 0x80, 0x00, 0x20, 0x08, + 0x06, 0x8f, 0x48, 0xc0, 0x03, 0x1e, 0xc8, 0x42, 0x30, 0x62, 0x80, 0x00, + 0x20, 0x08, 0x06, 0xcf, 0x48, 0xc4, 0x03, 0x1e, 0xb8, 0x42, 0x60, 0x7c, + 0xd0, 0x0b, 0xf2, 0x19, 0x31, 0x40, 0x00, 0x10, 0x04, 0x83, 0xa7, 0x24, + 0xe6, 0x81, 0x0f, 0x72, 0x21, 0x18, 0x31, 0x40, 0x00, 0x10, 0x04, 0x83, + 0xc7, 0x24, 0xe8, 0x81, 0x0f, 0x6a, 0x21, 0x18, 0x31, 0x40, 0x00, 0x10, + 0x04, 0x83, 0xe7, 0x24, 0xea, 0x81, 0x0f, 0x62, 0x21, 0x30, 0x50, 0x00, + 0x07, 0xf9, 0x8c, 0x18, 0x20, 0x00, 0x08, 0x82, 0xc1, 0x93, 0x12, 0xf7, + 0x00, 0x0a, 0xbc, 0x10, 0x8c, 0x18, 0x20, 0x00, 0x08, 0x82, 0xc1, 0xa3, + 0x12, 0xf8, 0x00, 0x0a, 0xb8, 0x10, 0x8c, 0x18, 0x20, 0x00, 0x08, 0x82, + 0xc1, 0xb3, 0x12, 0xf9, 0x00, 0x0a, 0xb4, 0x10, 0x58, 0x1f, 0xac, 0x83, + 0x7c, 0x46, 0x0c, 0x10, 0x00, 0x04, 0xc1, 0xe0, 0x69, 0x89, 0x7d, 0x58, + 0x07, 0x37, 0x08, 0x46, 0x0c, 0x10, 0x00, 0x04, 0xc1, 0xe0, 0x71, 0x09, + 0x7e, 0x58, 0x87, 0x2f, 0xb0, 0x00, 0x82, 0x8e, 0xf5, 0xc1, 0x3b, 0xc8, + 0x67, 0xc4, 0x00, 0x01, 0x40, 0x10, 0x0c, 0x9e, 0x98, 0xf8, 0x87, 0x77, + 0x70, 0x83, 0x60, 0xc4, 0x00, 0x01, 0x40, 0x10, 0x0c, 0x1e, 0x99, 0x00, + 0x89, 0x77, 0xf8, 0x02, 0x0b, 0x20, 0xe8, 0x58, 0x1f, 0xcc, 0x83, 0x7c, + 0x46, 0x0c, 0x10, 0x00, 0x04, 0xc1, 0xe0, 0xa9, 0x89, 0x91, 0x98, 0x07, + 0x37, 0x08, 0x46, 0x0c, 0x10, 0x00, 0x04, 0xc1, 0xe0, 0xb1, 0x09, 0x92, + 0x98, 0x87, 0x2f, 0xb0, 0x00, 0x82, 0x8e, 0xf5, 0xc1, 0x3d, 0xc8, 0x67, + 0xc4, 0x00, 0x01, 0x40, 0x10, 0x0c, 0x9e, 0x9c, 0x38, 0x89, 0x7b, 0x70, + 0x83, 0x60, 0xc4, 0x00, 0x01, 0x40, 0x10, 0x0c, 0x1e, 0x9d, 0x40, 0x89, + 0x7b, 0xf8, 0x02, 0x0b, 0x20, 0xe8, 0x8c, 0x18, 0x24, 0x00, 0x08, 0x82, + 0x01, 0xe2, 0x13, 0x29, 0x91, 0x13, 0x39, 0x01, 0x13, 0xff, 0x30, 0x62, + 0x90, 0x00, 0x20, 0x08, 0x06, 0x88, 0x4f, 0xa4, 0x44, 0x4e, 0xe4, 0x04, + 0x49, 0xf8, 0xc3, 0x88, 0x41, 0x02, 0x80, 0x20, 0x18, 0x20, 0x3e, 0x91, + 0x12, 0x39, 0x91, 0x13, 0x2d, 0xd1, 0x0f, 0x23, 0x06, 0x09, 0x00, 0x82, + 0x60, 0x80, 0xf8, 0x44, 0x4a, 0xe4, 0x44, 0x4e, 0xbc, 0x04, 0x3f, 0x8c, + 0x18, 0x24, 0x00, 0x08, 0x82, 0x01, 0xe2, 0x13, 0x29, 0xa1, 0x13, 0x39, + 0x01, 0x13, 0x21, 0x31, 0x62, 0x90, 0x00, 0x20, 0x08, 0x06, 0x88, 0x4f, + 0xa4, 0x84, 0x4e, 0xe4, 0x04, 0x49, 0x80, 0xc4, 0x88, 0x41, 0x02, 0x80, + 0x20, 0x18, 0x20, 0x3e, 0x91, 0x12, 0x32, 0x91, 0x13, 0x30, 0xd1, 0x8c, + 0x18, 0x24, 0x00, 0x08, 0x82, 0x01, 0xe2, 0x13, 0x29, 0x21, 0x13, 0x39, + 0x41, 0x12, 0xc9, 0x88, 0x41, 0x02, 0x80, 0x20, 0x18, 0x20, 0x3e, 0x91, + 0x12, 0x32, 0x91, 0x13, 0x2d, 0x51, 0x8c, 0x18, 0x24, 0x00, 0x08, 0x82, + 0x01, 0xe2, 0x13, 0x29, 0x21, 0x13, 0x39, 0xf1, 0x12, 0x01, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00 +}; diff --git a/examples/testgputext/shaders/shader.vert.sm60.hlsl b/examples/testgputext/shaders/shader.vert.sm60.hlsl new file mode 100644 index 00000000..77314aec --- /dev/null +++ b/examples/testgputext/shaders/shader.vert.sm60.hlsl @@ -0,0 +1,47 @@ +cbuffer _28_30 : register(b0, space1) +{ + row_major float4x4 _30_m0 : packoffset(c0); + row_major float4x4 _30_m1 : packoffset(c4); +}; + + +static float4 gl_Position; +static float4 _9; +static float4 _11; +static float2 _15; +static float2 _17; +static float3 _40; + +struct SPIRV_Cross_Input +{ + float3 _40 : TEXCOORD0; + float4 _11 : TEXCOORD1; + float2 _17 : TEXCOORD2; +}; + +struct SPIRV_Cross_Output +{ + float4 _9 : TEXCOORD0; + float2 _15 : TEXCOORD1; + float4 gl_Position : SV_Position; +}; + +void vert_main() +{ + _9 = _11; + _15 = _17; + gl_Position = mul(float4(_40, 1.0f), mul(_30_m1, _30_m0)); +} + +SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) +{ + _11 = stage_input._11; + _17 = stage_input._17; + _40 = stage_input._40; + vert_main(); + SPIRV_Cross_Output stage_output; + stage_output.gl_Position = gl_Position; + stage_output._9 = _9; + stage_output._15 = _15; + return stage_output; +} diff --git a/examples/testgputext/shaders/shader.vert.spv.h b/examples/testgputext/shaders/shader.vert.spv.h new file mode 100644 index 00000000..f147e2bf --- /dev/null +++ b/examples/testgputext/shaders/shader.vert.spv.h @@ -0,0 +1,109 @@ +static const unsigned char shader_vert_spv[] = { + 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, + 0x31, 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, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, + 0x09, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, + 0x11, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, + 0x47, 0x00, 0x04, 0x00, 0x09, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, + 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, + 0x0f, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x47, 0x00, 0x04, 0x00, 0x11, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x16, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x48, 0x00, 0x05, 0x00, 0x16, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x0b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, + 0x16, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x16, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x47, 0x00, 0x03, 0x00, 0x16, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x48, 0x00, 0x04, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x1c, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x48, 0x00, 0x05, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x48, 0x00, 0x04, 0x00, + 0x1c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, + 0x48, 0x00, 0x05, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x23, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, + 0x1c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x1c, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x1e, 0x00, 0x00, 0x00, + 0x22, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, + 0x1e, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x47, 0x00, 0x04, 0x00, 0x28, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x17, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x20, 0x00, 0x04, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x0a, 0x00, 0x00, 0x00, + 0x0b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, + 0x0d, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x20, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, + 0x0f, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, + 0x3b, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x13, 0x00, 0x00, 0x00, + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, + 0x13, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x1c, 0x00, 0x04, 0x00, 0x15, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x14, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x06, 0x00, 0x16, 0x00, 0x00, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, + 0x15, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x17, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, + 0x17, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x15, 0x00, 0x04, 0x00, 0x19, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x19, 0x00, 0x00, 0x00, + 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x04, 0x00, + 0x1b, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x1e, 0x00, 0x04, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00, + 0x1b, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x1d, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, + 0x1d, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x20, 0x00, 0x04, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x1b, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x19, 0x00, 0x00, 0x00, + 0x22, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, + 0x26, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x20, 0x00, 0x04, 0x00, 0x27, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x26, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x27, 0x00, 0x00, 0x00, + 0x28, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, + 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, + 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x0c, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, + 0x09, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, + 0x0d, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, + 0x3e, 0x00, 0x03, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, + 0x41, 0x00, 0x05, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x1e, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, + 0x1b, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x41, 0x00, 0x05, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, + 0x1e, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, + 0x1b, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, + 0x92, 0x00, 0x05, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, + 0x21, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, + 0x26, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, + 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, + 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x2d, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x50, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, + 0x2b, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x00, 0x00, + 0x2a, 0x00, 0x00, 0x00, 0x91, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x2f, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, + 0x41, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, + 0x18, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, + 0x30, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, + 0x38, 0x00, 0x01, 0x00 +}; +static const unsigned int shader_vert_spv_len = 1264; diff --git a/examples/testgputext/shaders/spir-v.h b/examples/testgputext/shaders/spir-v.h new file mode 100644 index 00000000..5db27c04 --- /dev/null +++ b/examples/testgputext/shaders/spir-v.h @@ -0,0 +1,2 @@ +#include "shader.vert.spv.h" +#include "shader.frag.spv.h" diff --git a/external/SDL b/external/SDL index f6fa6171..f79f2121 160000 --- a/external/SDL +++ b/external/SDL @@ -1 +1 @@ -Subproject commit f6fa61713931d06f21d6f76a38a860a50ee5e8d2 +Subproject commit f79f21217bbb7aba82d68076af5119956b44d046 diff --git a/include/SDL3_ttf/SDL_ttf.h b/include/SDL3_ttf/SDL_ttf.h index 9e00cf75..5efe7244 100644 --- a/include/SDL3_ttf/SDL_ttf.h +++ b/include/SDL3_ttf/SDL_ttf.h @@ -1605,6 +1605,85 @@ extern SDL_DECLSPEC bool SDLCALL TTF_DrawRendererText(TTF_Text *text, float x, f */ extern SDL_DECLSPEC void SDLCALL TTF_DestroyRendererTextEngine(TTF_TextEngine *engine); +/** + * Create a text engine for drawing text with the SDL GPU API. + * + * \param device the SDL_GPUDevice to use for creating textures and drawing text. + * \returns a TTF_TextEngine object or NULL on failure; call SDL_GetError() + * for more information. + * + * \threadsafety This function should be called on the thread that created the + * device. + * + * \since This function is available since SDL_ttf 3.0.0. + * + * \sa TTF_DestroyGPUTextEngine + */ +extern SDL_DECLSPEC TTF_TextEngine * SDLCALL TTF_CreateGPUTextEngine(SDL_GPUDevice *device); + +/** + * Draw sequence returned by TTF_GetGPUTextDrawData + * + * \since This struct is available since SDL_ttf 3.0.0. + * + * \sa TTF_GetGPUTextDrawData + */ +typedef struct TTF_GPUAtlasDrawSequence +{ + SDL_GPUTexture *atlas_texture; /**< Texture atlas that stores the glyphs */ + float *xy; /**< Vertex positions */ + int xy_stride; /**< Byte size to move from one element to the next element */ + float *uv; /**< Vertex normalized texture coordinates */ + int uv_stride; /**< Byte size to move from one element to the next element */ + int num_vertices; /**< Number of vertices */ + int *indices; /**< An array of indices into the 'vertices' arrays */ + int num_indices; /**< Number of indices */ + + struct TTF_GPUAtlasDrawSequence *next; /**< The next sequence (will be NULL in case of the last sequence) */ +} TTF_GPUAtlasDrawSequence; + +/** + * Get the geometry data needed for drawing the text. + * + * `text` must have been created using a TTF_TextEngine from + * TTF_CreateGPUTextEngine(). + * + * If the text looks blocky use linear filtering. + * + * \param text the text to draw. + * \returns a NULL terminated linked list of TTF_GPUAtlasDrawSequence objects or + * NULL if the passed text is empty or in case of failure; + * call SDL_GetError() for more information. + * + * \threadsafety This function should be called on the thread that created the + * text. + * + * \since This function is available since SDL_ttf 3.0.0. + * + * \sa TTF_CreateGPUTextEngine + * \sa TTF_CreateText + * \sa TTF_CreateText_Wrapped + */ +extern SDL_DECLSPEC TTF_GPUAtlasDrawSequence* SDLCALL TTF_GetGPUTextDrawData(TTF_Text *text); + +/** + * Destroy a text engine created for drawing text with the SDL GPU API. + * + * All text created by this engine should be destroyed before calling this + * function. + * + * \param engine a TTF_TextEngine object created with + * TTF_CreateGPUTextEngine(). + * + * \threadsafety This function should be called on the thread that created the + * engine. + * + * \since This function is available since SDL_ttf 3.0.0. + * + * \sa TTF_CreateGPUTextEngine + */ +extern SDL_DECLSPEC void SDLCALL TTF_DestroyGPUTextEngine(TTF_TextEngine *engine); + /** * Create a text object from UTF-8 text and a text engine. * diff --git a/src/SDL_gpu_textengine.c b/src/SDL_gpu_textengine.c new file mode 100644 index 00000000..a5e4e64e --- /dev/null +++ b/src/SDL_gpu_textengine.c @@ -0,0 +1,943 @@ +/* + SDL_ttf: A companion library to SDL for working with TrueType (tm) fonts + Copyright (C) 2001-2024 Sam Lantinga + + 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, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include + +#include "SDL_hashtable.h" + +#define ATLAS_TEXTURE_SIZE 256 + +#define STB_RECT_PACK_IMPLEMENTATION +#define STBRP_STATIC +#define STBRP_SORT SDL_qsort +#define STBRP_ASSERT SDL_assert +#define STBRP__CDECL SDLCALL +#include "stb_rect_pack.h" + +typedef struct AtlasGlyph AtlasGlyph; +typedef struct AtlasTexture AtlasTexture; +typedef struct TTF_GPUAtlasDrawSequence AtlasDrawSequence; + +struct AtlasGlyph +{ + int refcount; + AtlasTexture *atlas; + SDL_Rect rect; + float texcoords[8]; + AtlasGlyph *next; +}; + +struct AtlasTexture +{ + SDL_GPUTexture *texture; + stbrp_context packer; + stbrp_node *packing_nodes; + AtlasGlyph *free_glyphs; + AtlasTexture *next; +}; + +typedef struct TTF_GPUTextEngineTextData +{ + int num_glyphs; + AtlasGlyph **glyphs; + AtlasDrawSequence *draw_sequence; +} TTF_GPUTextEngineTextData; + +typedef struct TTF_GPUTextEngineFontData +{ + TTF_Font *font; + Uint32 generation; + SDL_HashTable *glyphs; +} TTF_GPUTextEngineFontData; + +typedef struct TTF_GPUTextEngineData +{ + SDL_GPUDevice *device; + SDL_HashTable *fonts; + AtlasTexture *atlas; +} TTF_GPUTextEngineData; + + +static int SDLCALL SortMissing(void *userdata, const void *a, const void *b) +{ + const TTF_DrawOperation *ops = (const TTF_DrawOperation *)userdata; + const stbrp_rect *A = (const stbrp_rect *)a; + const stbrp_rect *B = (const stbrp_rect *)b; + + // Sort missing first + if (!ops[A->id].copy.reserved) { + if (ops[B->id].copy.reserved) { + return -1; + } + } + if (!ops[B->id].copy.reserved) { + if (ops[A->id].copy.reserved) { + return 1; + } + } + + // Sort largest first + if (A->w != B->w) { + if (A->w > B->w) { + return -1; + } else { + return 1; + } + } + if (A->h != B->h) { + if (A->h > B->h) { + return -1; + } else { + return 1; + } + } + + // It doesn't matter, sort by ID + if (A->id < B->id) { + return -1; + } else { + return 1; + } +} + +static int SDLCALL SortOperations(const void *a, const void *b) +{ + const TTF_DrawOperation *A = (const TTF_DrawOperation *)a; + const TTF_DrawOperation *B = (const TTF_DrawOperation *)b; + + if (A->cmd == TTF_DRAW_COMMAND_COPY && + B->cmd == TTF_DRAW_COMMAND_COPY) { + AtlasGlyph *glyphA = (AtlasGlyph *)A->copy.reserved; + AtlasGlyph *glyphB = (AtlasGlyph *)B->copy.reserved; + if (glyphA->atlas != glyphB->atlas) { + // It's not important how we sort this, just that it's consistent + return (glyphA->atlas < glyphB->atlas) ? -1 : 1; + } + + // We could sort by texture coordinate or whatever, if we cared. + return 0; + } + + if (A->cmd == TTF_DRAW_COMMAND_COPY) { + return -1; + } + if (B->cmd == TTF_DRAW_COMMAND_COPY) { + return 1; + } + return 0; +} + +static void DestroyGlyph(AtlasGlyph* glyph) +{ + if (!glyph) { + return; + } + + SDL_free(glyph); +} + +static void DestroyAtlas(SDL_GPUDevice *device, AtlasTexture *atlas) +{ + if (!atlas) { + return; + } + + AtlasGlyph *next; + for (AtlasGlyph *glyph = atlas->free_glyphs; glyph; glyph = next) { + next = glyph->next; + DestroyGlyph(glyph); + } + + SDL_ReleaseGPUTexture(device, atlas->texture); + SDL_free(atlas->packing_nodes); + SDL_free(atlas); +} + +static AtlasTexture *CreateAtlas(SDL_GPUDevice *device) +{ + AtlasTexture *atlas = (AtlasTexture *)SDL_calloc(1, sizeof(*atlas)); + if (!atlas) { + return NULL; + } + + SDL_GPUTextureCreateInfo info = {0}; + info.type = SDL_GPU_TEXTURETYPE_2D; + info.format = SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM; + info.usage = SDL_GPU_TEXTUREUSAGE_SAMPLER; + info.width = ATLAS_TEXTURE_SIZE; + info.height = ATLAS_TEXTURE_SIZE; + info.layer_count_or_depth = 1; + info.num_levels = 1; + + atlas->texture = SDL_CreateGPUTexture(device, &info); + + if (!atlas->texture) { + DestroyAtlas(device, atlas); + return NULL; + } + + int num_nodes = ATLAS_TEXTURE_SIZE / 4; + atlas->packing_nodes = (stbrp_node *)SDL_calloc(num_nodes, sizeof(*atlas->packing_nodes)); + if (!atlas->packing_nodes) { + DestroyAtlas(device, atlas); + return NULL; + } + stbrp_init_target(&atlas->packer, ATLAS_TEXTURE_SIZE, ATLAS_TEXTURE_SIZE, atlas->packing_nodes, num_nodes); + stbrp_setup_heuristic(&atlas->packer, STBRP_HEURISTIC_Skyline_default); + + return atlas; +} + +static void ReleaseGlyph(AtlasGlyph *glyph) +{ + if (!glyph) { + return; + } + + --glyph->refcount; + if (glyph->refcount == 0) { + if (glyph->atlas) { + // Insert into free list sorted smallest first + AtlasGlyph *entry, *prev = NULL; + int size = (glyph->rect.w * glyph->rect.h); + for (entry = glyph->atlas->free_glyphs; entry; entry = entry->next) { + if (size <= (entry->rect.w * entry->rect.h)) { + break; + } + + prev = entry; + } + + if (prev) { + prev->next = glyph; + } else { + glyph->atlas->free_glyphs = glyph; + } + glyph->next = entry; + } else { + DestroyGlyph(glyph); + } + } +} + +static AtlasGlyph *CreateGlyph(AtlasTexture *atlas, const stbrp_rect *area) +{ + AtlasGlyph *glyph = (AtlasGlyph *)SDL_calloc(1, sizeof(*glyph)); + if (!glyph) { + return NULL; + } + + glyph->refcount = 1; + glyph->atlas = atlas; + glyph->rect.x = area->x; + glyph->rect.y = area->y; + glyph->rect.w = area->w - 1; + glyph->rect.h = area->h - 1; + + const float minu = (float)area->x / ATLAS_TEXTURE_SIZE; + const float minv = (float)area->y / ATLAS_TEXTURE_SIZE; + const float maxu = (float)(area->x + area->w) / ATLAS_TEXTURE_SIZE; + const float maxv = (float)(area->y + area->h) / ATLAS_TEXTURE_SIZE; + glyph->texcoords[0] = minu; + glyph->texcoords[1] = minv; + glyph->texcoords[2] = maxu; + glyph->texcoords[3] = minv; + glyph->texcoords[4] = maxu; + glyph->texcoords[5] = maxv; + glyph->texcoords[6] = minu; + glyph->texcoords[7] = maxv; + + return glyph; +} + +static AtlasGlyph *FindUnusedGlyph(AtlasTexture *atlas, int width, int height) +{ + AtlasGlyph *glyph, *prev = NULL; + + int size = (width * height); + for (glyph = atlas->free_glyphs; glyph; glyph = glyph->next) { + if (width == glyph->rect.w && height == glyph->rect.h) { + if (prev) { + prev->next = glyph->next; + } else { + atlas->free_glyphs = glyph->next; + } + ++glyph->refcount; + return glyph; + } + + if (size < (glyph->rect.w * glyph->rect.h)) { + // We didn't find any entries our size, everything else is larger than we want + break; + } + + prev = glyph; + } + + if (atlas->next) { + return FindUnusedGlyph(atlas->next, width, height); + } + return NULL; +} + +static bool UpdateGPUTexture(SDL_GPUDevice *device, SDL_GPUTexture *texture, + const SDL_Rect *rect, const void *pixels, int pitch) +{ + const Uint32 texturebpp = 4; + + size_t row_size, data_size; + + if (!SDL_size_mul_check_overflow(rect->w, texturebpp, &row_size) || + !SDL_size_mul_check_overflow(rect->h, row_size, &data_size)) { + return SDL_SetError("update size overflow"); + } + + SDL_GPUTransferBufferCreateInfo tbci; + SDL_zero(tbci); + tbci.size = (Uint32)data_size; + tbci.usage = SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD; + + SDL_GPUTransferBuffer *tbuf = SDL_CreateGPUTransferBuffer(device, &tbci); + + if (tbuf == NULL) { + return false; + } + + Uint8 *output = SDL_MapGPUTransferBuffer(device, tbuf, false); + + if ((size_t)pitch == row_size) { + SDL_memcpy(output, pixels, data_size); + } else { + // FIXME is negative pitch supposed to work? + // If not, maybe use SDL_GPUTextureTransferInfo::pixels_per_row instead of this + const Uint8 *input = pixels; + + for (int i = 0; i < rect->h; ++i) { + SDL_memcpy(output, input, row_size); + output += row_size; + input += pitch; + } + } + + SDL_UnmapGPUTransferBuffer(device, tbuf); + + SDL_GPUCommandBuffer *cbuf = SDL_AcquireGPUCommandBuffer(device); + SDL_GPUCopyPass *cpass = SDL_BeginGPUCopyPass(cbuf); + + SDL_GPUTextureTransferInfo tex_src; + SDL_zero(tex_src); + tex_src.transfer_buffer = tbuf; + tex_src.rows_per_layer = rect->h; + tex_src.pixels_per_row = rect->w; + + SDL_GPUTextureRegion tex_dst; + SDL_zero(tex_dst); + tex_dst.texture = texture; + tex_dst.x = rect->x; + tex_dst.y = rect->y; + tex_dst.w = rect->w; + tex_dst.h = rect->h; + tex_dst.d = 1; + + SDL_UploadToGPUTexture(cpass, &tex_src, &tex_dst, false); + SDL_EndGPUCopyPass(cpass); + SDL_ReleaseGPUTransferBuffer(device, tbuf); + SDL_SubmitGPUCommandBuffer(cbuf); + + return true; +} + +static bool UpdateGlyph(SDL_GPUDevice *device, AtlasGlyph *glyph, SDL_Surface *surface) +{ + /* FIXME: We should update the whole texture at once or at least cache the transfer buffers */ + UpdateGPUTexture(device, glyph->atlas->texture, &glyph->rect, surface->pixels, surface->pitch); + return true; +} + +static bool AddGlyphToFont(TTF_GPUTextEngineFontData *fontdata, Uint32 glyph_index, AtlasGlyph *glyph) +{ + if (!SDL_InsertIntoHashTable(fontdata->glyphs, (const void *)(uintptr_t)glyph_index, glyph)) { + return false; + } + return true; +} + +static bool ResolveMissingGlyphs(TTF_GPUTextEngineData *enginedata, AtlasTexture *atlas, TTF_GPUTextEngineFontData *fontdata, SDL_Surface **surfaces, TTF_DrawOperation *ops, int num_ops, stbrp_rect *missing, int num_missing) +{ + // See if we can reuse any existing entries + if (atlas->free_glyphs) { + // Search from the smallest to the largest to minimize time spent searching the free list and shortening the missing entries + for (int i = num_missing; i--; ) { + AtlasGlyph *glyph = FindUnusedGlyph(atlas, missing[i].w, missing[i].h); + if (!glyph) { + continue; + } + + if (!UpdateGlyph(enginedata->device, glyph, surfaces[missing[i].id])) { + ReleaseGlyph(glyph); + return false; + } + + if (!AddGlyphToFont(fontdata, ops[missing[i].id].copy.glyph_index, glyph)) { + ReleaseGlyph(glyph); + return false; + } + + ops[missing[i].id].copy.reserved = glyph; + + // Remove this from the missing entries + --num_missing; + if (i < num_missing) { + SDL_memcpy(&missing[i], &missing[i+1], (num_missing - i) * sizeof(missing[i])); + } + } + if (num_missing == 0) { + return true; + } + } + + // Try to pack all the missing glyphs into the current atlas + bool all_packed = (stbrp_pack_rects(&atlas->packer, missing, num_missing) == 1); + + for (int i = 0; i < num_missing; ++i) { + if (!missing[i].was_packed) { + continue; + } + + AtlasGlyph *glyph = CreateGlyph(atlas, &missing[i]); + if (!glyph) { + return false; + } + + if (!UpdateGlyph(enginedata->device, glyph, surfaces[missing[i].id])) { + ReleaseGlyph(glyph); + return false; + } + + if (!AddGlyphToFont(fontdata, ops[missing[i].id].copy.glyph_index, glyph)) { + ReleaseGlyph(glyph); + return false; + } + + ops[missing[i].id].copy.reserved = glyph; + } + + if (all_packed) { + return true; + } + + // Sort the remaining missing glyphs and try in the next atlas + SDL_qsort_r(missing, num_missing, sizeof(*missing), SortMissing, ops); + for (int i = 0; i < num_missing; ++i) { + if (ops[missing[i].id].copy.reserved) { + // No longer missing! + num_missing = i; + break; + } + } + + if (!atlas->next) { + atlas->next = CreateAtlas(enginedata->device); + if (!atlas->next) { + return false; + } + } + return ResolveMissingGlyphs(enginedata, atlas->next, fontdata, surfaces, ops, num_ops, missing, num_missing); +} + +static bool CreateMissingGlyphs(TTF_GPUTextEngineData *enginedata, TTF_GPUTextEngineFontData *fontdata, TTF_DrawOperation *ops, int num_ops, int num_missing) +{ + stbrp_rect *missing = NULL; + SDL_Surface **surfaces = NULL; + SDL_HashTable *checked = NULL; + bool result = false; + + // Build a list of missing glyphs + missing = (stbrp_rect *)SDL_calloc(num_missing, sizeof(*missing)); + if (!missing) { + goto done; + } + + surfaces = (SDL_Surface **)SDL_calloc(num_ops, sizeof(*surfaces)); + if (!surfaces) { + goto done; + } + + checked = SDL_CreateHashTable(NULL, 4, SDL_HashID, SDL_KeyMatchID, NULL, false); + if (!checked) { + goto done; + } + + int missing_index = 0; + for (int i = 0; i < num_ops; ++i) { + TTF_DrawOperation *op = &ops[i]; + if (op->cmd == TTF_DRAW_COMMAND_COPY && !op->copy.reserved) { + Uint32 glyph_index = op->copy.glyph_index; + if (SDL_FindInHashTable(checked, (const void *)(uintptr_t)glyph_index, NULL)) { + continue; + } + if (!SDL_InsertIntoHashTable(checked, (const void *)(uintptr_t)glyph_index, NULL)) { + goto done; + } + + surfaces[i] = TTF_GetGlyphImageForIndex(fontdata->font, glyph_index); + if (!surfaces[i]) { + goto done; + } + if (surfaces[i]->w > ATLAS_TEXTURE_SIZE || surfaces[i]->h > ATLAS_TEXTURE_SIZE) { + SDL_SetError("Glyph surface %dx%d larger than atlas texture %dx%d", + surfaces[i]->w, surfaces[i]->h, + ATLAS_TEXTURE_SIZE, ATLAS_TEXTURE_SIZE); + goto done; + } + + missing[missing_index].id = i; + missing[missing_index].w = surfaces[i]->w + 1; + missing[missing_index].h = surfaces[i]->h + 1; + ++missing_index; + } + } + num_missing = missing_index; + + // Sort the glyphs by size + SDL_qsort_r(missing, num_missing, sizeof(*missing), SortMissing, ops); + + // Create the texture atlas if necessary + if (!enginedata->atlas) { + enginedata->atlas = CreateAtlas(enginedata->device); + if (!enginedata->atlas) { + goto done; + } + } + + if (!ResolveMissingGlyphs(enginedata, enginedata->atlas, fontdata, surfaces, ops, num_ops, missing, num_missing)) { + goto done; + } + + // Resolve any duplicates + for (int i = 0; i < num_ops; ++i) { + TTF_DrawOperation *op = &ops[i]; + if (op->cmd == TTF_DRAW_COMMAND_COPY && !op->copy.reserved) { + if (!SDL_FindInHashTable(fontdata->glyphs, (const void *)(uintptr_t)op->copy.glyph_index, (const void **)&op->copy.reserved)) { + // Something is very wrong... + goto done; + } + } + } + + result = true; + +done: + SDL_DestroyHashTable(checked); + if (surfaces) { + for (int i = 0; i < num_ops; ++i) { + SDL_DestroySurface(surfaces[i]); + } + SDL_free(surfaces); + } + SDL_free(missing); + return result; +} + +static void DestroyDrawSequence(AtlasDrawSequence *data) +{ + if (!data) { + return; + } + + if (data->next) { + DestroyDrawSequence(data->next); + } + SDL_free(data->xy); + SDL_free(data->uv); + SDL_free(data->indices); + SDL_free(data); +} + +static SDL_GPUTexture *GetOperationTexture(TTF_DrawOperation *op) +{ + if (op->cmd == TTF_DRAW_COMMAND_COPY) { + AtlasGlyph *glyph = (AtlasGlyph *)op->copy.reserved; + return glyph->atlas->texture; + } + return NULL; +} + +static AtlasDrawSequence *CreateDrawSequence(TTF_DrawOperation *ops, int num_ops) +{ + AtlasDrawSequence *sequence = (AtlasDrawSequence *)SDL_calloc(1, sizeof(*sequence)); + if (!sequence) { + return NULL; + } + + SDL_assert(num_ops > 0); + + SDL_GPUTexture *texture = GetOperationTexture(&ops[0]); + TTF_DrawOperation *end = NULL; + for (int i = 1; i < num_ops; ++i) { + if (GetOperationTexture(&ops[i]) != texture) { + end = &ops[i]; + break; + } + } + + int count = (end ? (int)(end - ops) : num_ops); + sequence->atlas_texture = texture; + sequence->num_vertices = count * 4; + sequence->num_indices = count * 6; + sequence->xy_stride = sizeof(float) * 2; + sequence->uv_stride = sizeof(float) * 2; + + if (texture) { + AtlasGlyph *glyph; + + sequence->uv = (float *)SDL_malloc(count * sizeof(glyph->texcoords)); + if (!sequence->uv) { + DestroyDrawSequence(sequence); + return NULL; + } + + float *uv = sequence->uv; + for (int i = 0; i < count; ++i) { + AtlasGlyph *glyph = (AtlasGlyph *)ops[i].copy.reserved; + SDL_memcpy(uv, glyph->texcoords, sizeof(glyph->texcoords)); + uv += SDL_arraysize(glyph->texcoords); + } + } + + sequence->xy = (float *)SDL_malloc(count * 8 * sizeof(*sequence->xy)); + if (!sequence->xy) { + DestroyDrawSequence(sequence); + return NULL; + } + float *xy = sequence->xy; + for (int i = 0; i < count; ++i) { + TTF_DrawOperation *op = &ops[i]; + SDL_Rect *dst = NULL; + switch (op->cmd) { + case TTF_DRAW_COMMAND_FILL: + dst = &op->fill.rect; + break; + case TTF_DRAW_COMMAND_COPY: + dst = &op->copy.dst; + break; + default: + break; + } + + float minx = (float)dst->x; + float maxx = (float)(dst->x + dst->w); + float miny = (float)dst->y; + float maxy = (float)(dst->y + dst->h); + + // In the GPU API postive y-axis is upwards so the signs of the y-coords is reversed + *xy++ = minx; + *xy++ = -miny; + *xy++ = maxx; + *xy++ = -miny; + *xy++ = maxx; + *xy++ = -maxy; + *xy++ = minx; + *xy++ = -maxy; + } + + sequence->indices = (int *)SDL_malloc(count * 12 * sizeof(*sequence->indices)); + if (!sequence->indices) { + DestroyDrawSequence(sequence); + return NULL; + } + + static const Uint8 rect_index_order[] = { 0, 1, 2, 0, 2, 3 }; + int vertex_index = 0; + int *indices = sequence->indices; + for (int i = 0; i < count; ++i) { + *indices++ = vertex_index + rect_index_order[0]; + *indices++ = vertex_index + rect_index_order[1]; + *indices++ = vertex_index + rect_index_order[2]; + *indices++ = vertex_index + rect_index_order[3]; + *indices++ = vertex_index + rect_index_order[4]; + *indices++ = vertex_index + rect_index_order[5]; + vertex_index += 4; + } + + if (count < num_ops) { + sequence->next = CreateDrawSequence(ops + count, num_ops - count); + if (!sequence->next) { + DestroyDrawSequence(sequence); + return NULL; + } + } + return sequence; +} + +static void DestroyTextData(TTF_GPUTextEngineTextData *data) +{ + if (!data) { + return; + } + + DestroyDrawSequence(data->draw_sequence); + + for (int i = 0; i < data->num_glyphs; ++i) { + ReleaseGlyph(data->glyphs[i]); + } + SDL_free(data->glyphs); + SDL_free(data); +} + +static TTF_GPUTextEngineTextData *CreateTextData(TTF_GPUTextEngineData *enginedata, TTF_GPUTextEngineFontData *fontdata, TTF_DrawOperation *ops, int num_ops) +{ + TTF_GPUTextEngineTextData *data = (TTF_GPUTextEngineTextData *)SDL_calloc(1, sizeof(*data)); + if (!data) { + return NULL; + } + + // First, match draw operations to existing glyphs + int num_glyphs = 0; + int num_missing = 0; + for (int i = 0; i < num_ops; ++i) { + TTF_DrawOperation *op = &ops[i]; + + if (op->cmd != TTF_DRAW_COMMAND_COPY) { + continue; + } + + ++num_glyphs; + + if (!SDL_FindInHashTable(fontdata->glyphs, (const void *)(uintptr_t)op->copy.glyph_index, (const void **)&op->copy.reserved)) { + ++num_missing; + } + } + + // Create any missing glyphs + if (num_missing > 0) { + if (!CreateMissingGlyphs(enginedata, fontdata, ops, num_ops, num_missing)) { + DestroyTextData(data); + return NULL; + } + } + + // Add references to all the glyphs + data->glyphs = (AtlasGlyph **)SDL_malloc(num_glyphs * sizeof(*data->glyphs)); + for (int i = 0; i < num_ops; ++i) { + TTF_DrawOperation *op = &ops[i]; + + if (op->cmd != TTF_DRAW_COMMAND_COPY) { + continue; + } + + AtlasGlyph *glyph = (AtlasGlyph*)op->copy.reserved; + ++glyph->refcount; + data->glyphs[data->num_glyphs++] = glyph; + } + + // Sort the operations to batch by texture + SDL_qsort(ops, num_ops, sizeof(*ops), SortOperations); + + // Create batched draw sequences + data->draw_sequence = CreateDrawSequence(ops, num_ops); + if (!data->draw_sequence) { + DestroyTextData(data); + return NULL; + } + + return data; +} + +static void DestroyFontData(TTF_GPUTextEngineFontData *data) +{ + if (data) { + if (data->glyphs) { + SDL_DestroyHashTable(data->glyphs); + } + SDL_free(data); + } +} + +static void NukeGlyph(const void *key, const void *value, void *unused) +{ + AtlasGlyph *glyph = (AtlasGlyph *)value; + (void)key; + (void)unused; + ReleaseGlyph(glyph); +} + +static TTF_GPUTextEngineFontData *CreateFontData(TTF_GPUTextEngineData *enginedata, TTF_Font *font, Uint32 font_generation) +{ + TTF_GPUTextEngineFontData *data = (TTF_GPUTextEngineFontData *)SDL_calloc(1, sizeof(*data)); + if (!data) { + return NULL; + } + data->font = font; + data->generation = font_generation; + data->glyphs = SDL_CreateHashTable(NULL, 4, SDL_HashID, SDL_KeyMatchID, NukeGlyph, false); + if (!data->glyphs) { + DestroyFontData(data); + return NULL; + } + + if (!SDL_InsertIntoHashTable(enginedata->fonts, font, data)) { + DestroyFontData(data); + return NULL; + } + + return data; +} + +static void DestroyEngineData(TTF_GPUTextEngineData *data) +{ + if (!data) { + return; + } + + if (data->fonts) { + SDL_DestroyHashTable(data->fonts); + } + + AtlasTexture *next; + for (AtlasTexture *atlas = data->atlas; atlas; atlas = next) { + next = atlas->next; + DestroyAtlas(data->device, atlas); + } + SDL_free(data); +} + +static void NukeFontData(const void *key, const void *value, void *unused) +{ + TTF_GPUTextEngineFontData *data = (TTF_GPUTextEngineFontData *)value; + (void)key; + (void)unused; + DestroyFontData(data); +} + +static TTF_GPUTextEngineData *CreateEngineData(SDL_GPUDevice *device) +{ + TTF_GPUTextEngineData *data = (TTF_GPUTextEngineData *)SDL_calloc(1, sizeof(*data)); + if (!data) { + return NULL; + } + data->device = device; + + data->fonts = SDL_CreateHashTable(NULL, 4, SDL_HashPointer, SDL_KeyMatchPointer, NukeFontData, false); + if (!data->fonts) { + DestroyEngineData(data); + return NULL; + } + return data; +} + +static bool SDLCALL CreateText(void *userdata, TTF_Text *text) +{ + TTF_Font *font = text->internal->font; + Uint32 font_generation = TTF_GetFontGeneration(font); + int num_ops = text->internal->num_ops; + TTF_DrawOperation *ops; + TTF_GPUTextEngineData *enginedata = (TTF_GPUTextEngineData *)userdata; + TTF_GPUTextEngineFontData *fontdata; + TTF_GPUTextEngineTextData *data; + + if (!SDL_FindInHashTable(enginedata->fonts, font, (const void **)&fontdata)) { + fontdata = CreateFontData(enginedata, font, font_generation); + if (!fontdata) { + return false; + } + } else if (font_generation != fontdata->generation) { + SDL_EmptyHashTable(fontdata->glyphs); + fontdata->generation = font_generation; + } + + // Make a sortable copy of the draw operations + ops = (TTF_DrawOperation *)SDL_malloc(num_ops * sizeof(*ops)); + if (!ops) { + return false; + } + SDL_memcpy(ops, text->internal->ops, num_ops * sizeof(*ops)); + + data = CreateTextData(enginedata, fontdata, ops, num_ops); + SDL_free(ops); + if (!data) { + return false; + } + text->internal->engine_text = data; + return true; +} + +static void SDLCALL DestroyText(void *userdata, TTF_Text *text) +{ + TTF_GPUTextEngineTextData *data = (TTF_GPUTextEngineTextData *)text->internal->engine_text; + + (void)userdata; + DestroyTextData(data); +} + +void TTF_DestroyGPUTextEngine(TTF_TextEngine *engine) +{ + if (!engine || engine->CreateText != CreateText) { + return; + } + + DestroyEngineData((TTF_GPUTextEngineData *)engine->userdata); + engine->CreateText = NULL; + SDL_free(engine); +} + +TTF_TextEngine *TTF_CreateGPUTextEngine(SDL_GPUDevice *device) +{ + if (!device) { + SDL_InvalidParamError("device"); + return NULL; + } + + TTF_TextEngine *engine = (TTF_TextEngine *)SDL_malloc(sizeof(*engine)); + if (!engine) { + return NULL; + } + + SDL_INIT_INTERFACE(engine); + engine->CreateText = CreateText; + engine->DestroyText = DestroyText; + engine->userdata = CreateEngineData(device); + if (!engine->userdata) { + TTF_DestroyGPUTextEngine(engine); + return NULL; + } + return engine; +} + +AtlasDrawSequence* TTF_GetGPUTextDrawData(TTF_Text *text) +{ + if (!text || !text->internal || text->internal->engine->CreateText != CreateText) { + SDL_InvalidParamError("text"); + return NULL; + } + + // Make sure the text is up to date + if (!TTF_UpdateText(text)) { + return NULL; + } + + TTF_GPUTextEngineTextData *data = (TTF_GPUTextEngineTextData *)text->internal->engine_text; + if (!data) { + // Empty string, nothing to do + return NULL; + } + + return data->draw_sequence; +} diff --git a/src/SDL_ttf.sym b/src/SDL_ttf.sym index a91bf474..ea036652 100644 --- a/src/SDL_ttf.sym +++ b/src/SDL_ttf.sym @@ -2,10 +2,12 @@ SDL3_ttf_0.0.0 { global: TTF_AppendTextString; TTF_CloseFont; + TTF_CreateGPUTextEngine; TTF_CreateRendererTextEngine; TTF_CreateSurfaceTextEngine; TTF_CreateText; TTF_DeleteTextString; + TTF_DestroyGPUTextEngine; TTF_DestroyRendererTextEngine; TTF_DestroySurfaceTextEngine; TTF_DestroyText; @@ -37,6 +39,7 @@ SDL3_ttf_0.0.0 { TTF_GetGlyphKerning; TTF_GetGlyphMetrics; TTF_GetGlyphScript; + TTF_GetGPUTextDrawData; TTF_GetHarfBuzzVersion; TTF_GetNextTextSubString; TTF_GetPreviousTextSubString;