// Copyright 2013 Dolphin Emulator Project // Licensed under GPLv2+ // Refer to the license.txt file included. #pragma once #include #include "Common/CommonTypes.h" // all constant buffer attributes must be 16 bytes aligned, so this are the only allowed components: using float4 = std::array; using uint4 = std::array; using int4 = std::array; struct PixelShaderConstants { std::array colors; std::array kcolors; int4 alpha; std::array texdims; std::array zbias; std::array indtexscale; std::array indtexmtx; int4 fogcolor; int4 fogi; float4 fogf; std::array fogrange; float4 zslope; std::array efbscale; // .xy // Constants from here onwards are only used in ubershaders. u32 genmode; // .z u32 alphaTest; // .w u32 fogParam3; // .x u32 fogRangeBase; // .y u32 dstalpha; // .z u32 ztex_op; // .w u32 late_ztest; // .x (bool) u32 rgba6_format; // .y (bool) u32 dither; // .z (bool) u32 bounding_box; // .w (bool) std::array pack1; // .xy - combiners, .z - tevind, .w - iref std::array pack2; // .x - tevorder, .y - tevksel std::array konst; // .rgba // The following are used in ubershaders when using shader_framebuffer_fetch blending u32 blend_enable; u32 blend_src_factor; u32 blend_src_factor_alpha; u32 blend_dst_factor; u32 blend_dst_factor_alpha; u32 blend_subtract; u32 blend_subtract_alpha; }; struct VertexShaderConstants { u32 components; // .x u32 xfmem_dualTexInfo; // .y u32 xfmem_numColorChans; // .z u32 color_chan_alpha; // .w std::array posnormalmatrix; std::array projection; std::array materials; struct Light { int4 color; float4 cosatt; float4 distatt; float4 pos; float4 dir; }; std::array lights; std::array texmatrices; std::array transformmatrices; std::array normalmatrices; std::array posttransformmatrices; float4 pixelcentercorrection; std::array viewport; // .xy std::array pad2; // .zw // .x - texMtxInfo, .y - postMtxInfo, [0..1].z = color, [0..1].w = alpha std::array xfmem_pack1; }; struct GeometryShaderConstants { float4 stereoparams; float4 lineptparams; int4 texoffset; };