yuzu-emu
/
yuzu-mainline
Archived
1
0
Fork 0

shader: Track legacy varyings

This commit is contained in:
ReinUsesLisp 2021-05-31 04:19:31 -03:00 committed by ameerj
parent 05d41fa9b7
commit ac0f5d2ab6
2 changed files with 105 additions and 17 deletions

View File

@ -43,14 +43,11 @@ void GetAttribute(Info& info, IR::Attribute attribute) {
case IR::Attribute::PositionW: case IR::Attribute::PositionW:
info.loads_position = true; info.loads_position = true;
break; break;
case IR::Attribute::InstanceId: case IR::Attribute::ColorFrontDiffuseR:
info.loads_instance_id = true; case IR::Attribute::ColorFrontDiffuseG:
break; case IR::Attribute::ColorFrontDiffuseB:
case IR::Attribute::VertexId: case IR::Attribute::ColorFrontDiffuseA:
info.loads_vertex_id = true; info.loads_color_front_diffuse = true;
break;
case IR::Attribute::FrontFace:
info.loads_front_face = true;
break; break;
case IR::Attribute::PointSpriteS: case IR::Attribute::PointSpriteS:
case IR::Attribute::PointSpriteT: case IR::Attribute::PointSpriteT:
@ -60,6 +57,15 @@ void GetAttribute(Info& info, IR::Attribute attribute) {
case IR::Attribute::TessellationEvaluationPointV: case IR::Attribute::TessellationEvaluationPointV:
info.loads_tess_coord = true; info.loads_tess_coord = true;
break; break;
case IR::Attribute::InstanceId:
info.loads_instance_id = true;
break;
case IR::Attribute::VertexId:
info.loads_vertex_id = true;
break;
case IR::Attribute::FrontFace:
info.loads_front_face = true;
break;
default: default:
throw NotImplementedException("Get attribute {}", attribute); throw NotImplementedException("Get attribute {}", attribute);
} }
@ -71,6 +77,12 @@ void SetAttribute(Info& info, IR::Attribute attribute) {
return; return;
} }
switch (attribute) { switch (attribute) {
case IR::Attribute::Layer:
info.stores_layer = true;
break;
case IR::Attribute::ViewportIndex:
info.stores_viewport_index = true;
break;
case IR::Attribute::PointSize: case IR::Attribute::PointSize:
info.stores_point_size = true; info.stores_point_size = true;
break; break;
@ -80,6 +92,72 @@ void SetAttribute(Info& info, IR::Attribute attribute) {
case IR::Attribute::PositionW: case IR::Attribute::PositionW:
info.stores_position = true; info.stores_position = true;
break; break;
case IR::Attribute::ColorFrontDiffuseR:
case IR::Attribute::ColorFrontDiffuseG:
case IR::Attribute::ColorFrontDiffuseB:
case IR::Attribute::ColorFrontDiffuseA:
info.stores_color_front_diffuse = true;
break;
case IR::Attribute::ColorFrontSpecularR:
case IR::Attribute::ColorFrontSpecularG:
case IR::Attribute::ColorFrontSpecularB:
case IR::Attribute::ColorFrontSpecularA:
info.stores_color_front_specular = true;
break;
case IR::Attribute::ColorBackDiffuseR:
case IR::Attribute::ColorBackDiffuseG:
case IR::Attribute::ColorBackDiffuseB:
case IR::Attribute::ColorBackDiffuseA:
info.stores_color_back_diffuse = true;
break;
case IR::Attribute::ColorBackSpecularR:
case IR::Attribute::ColorBackSpecularG:
case IR::Attribute::ColorBackSpecularB:
case IR::Attribute::ColorBackSpecularA:
info.stores_color_front_specular = true;
break;
case IR::Attribute::FixedFncTexture0S:
case IR::Attribute::FixedFncTexture0T:
case IR::Attribute::FixedFncTexture0R:
case IR::Attribute::FixedFncTexture0Q:
case IR::Attribute::FixedFncTexture1S:
case IR::Attribute::FixedFncTexture1T:
case IR::Attribute::FixedFncTexture1R:
case IR::Attribute::FixedFncTexture1Q:
case IR::Attribute::FixedFncTexture2S:
case IR::Attribute::FixedFncTexture2T:
case IR::Attribute::FixedFncTexture2R:
case IR::Attribute::FixedFncTexture2Q:
case IR::Attribute::FixedFncTexture3S:
case IR::Attribute::FixedFncTexture3T:
case IR::Attribute::FixedFncTexture3R:
case IR::Attribute::FixedFncTexture3Q:
case IR::Attribute::FixedFncTexture4S:
case IR::Attribute::FixedFncTexture4T:
case IR::Attribute::FixedFncTexture4R:
case IR::Attribute::FixedFncTexture4Q:
case IR::Attribute::FixedFncTexture5S:
case IR::Attribute::FixedFncTexture5T:
case IR::Attribute::FixedFncTexture5R:
case IR::Attribute::FixedFncTexture5Q:
case IR::Attribute::FixedFncTexture6S:
case IR::Attribute::FixedFncTexture6T:
case IR::Attribute::FixedFncTexture6R:
case IR::Attribute::FixedFncTexture6Q:
case IR::Attribute::FixedFncTexture7S:
case IR::Attribute::FixedFncTexture7T:
case IR::Attribute::FixedFncTexture7R:
case IR::Attribute::FixedFncTexture7Q:
case IR::Attribute::FixedFncTexture8S:
case IR::Attribute::FixedFncTexture8T:
case IR::Attribute::FixedFncTexture8R:
case IR::Attribute::FixedFncTexture8Q:
case IR::Attribute::FixedFncTexture9S:
case IR::Attribute::FixedFncTexture9T:
case IR::Attribute::FixedFncTexture9R:
case IR::Attribute::FixedFncTexture9Q:
info.stores_fixed_fnc_textures = true;
break;
case IR::Attribute::ClipDistance0: case IR::Attribute::ClipDistance0:
case IR::Attribute::ClipDistance1: case IR::Attribute::ClipDistance1:
case IR::Attribute::ClipDistance2: case IR::Attribute::ClipDistance2:
@ -90,11 +168,8 @@ void SetAttribute(Info& info, IR::Attribute attribute) {
case IR::Attribute::ClipDistance7: case IR::Attribute::ClipDistance7:
info.stores_clip_distance = true; info.stores_clip_distance = true;
break; break;
case IR::Attribute::Layer: case IR::Attribute::FogCoordinate:
info.stores_layer = true; info.stores_fog_coordinate = true;
break;
case IR::Attribute::ViewportIndex:
info.stores_viewport_index = true;
break; break;
case IR::Attribute::ViewportMask: case IR::Attribute::ViewportMask:
info.stores_viewport_mask = true; info.stores_viewport_mask = true;

View File

@ -122,26 +122,39 @@ struct Info {
std::array<InputVarying, 32> input_generics{}; std::array<InputVarying, 32> input_generics{};
bool loads_primitive_id{}; bool loads_primitive_id{};
bool loads_position{}; bool loads_position{};
bool loads_color_front_diffuse{};
bool loads_point_coord{};
bool loads_instance_id{}; bool loads_instance_id{};
bool loads_vertex_id{}; bool loads_vertex_id{};
bool loads_front_face{}; bool loads_front_face{};
bool loads_point_coord{};
bool loads_tess_coord{}; bool loads_tess_coord{};
bool loads_indexed_attributes{}; bool loads_indexed_attributes{};
std::array<bool, 8> stores_frag_color{}; std::array<bool, 8> stores_frag_color{};
bool stores_sample_mask{}; bool stores_sample_mask{};
bool stores_frag_depth{}; bool stores_frag_depth{};
std::array<bool, 32> stores_generics{}; std::array<bool, 32> stores_generics{};
bool stores_position{};
bool stores_point_size{};
bool stores_clip_distance{};
bool stores_layer{}; bool stores_layer{};
bool stores_viewport_index{}; bool stores_viewport_index{};
bool stores_point_size{};
bool stores_position{};
bool stores_color_front_diffuse{};
bool stores_color_front_specular{};
bool stores_color_back_diffuse{};
bool stores_color_back_specular{};
bool stores_fixed_fnc_textures{};
bool stores_clip_distance{};
bool stores_fog_coordinate{};
bool stores_viewport_mask{}; bool stores_viewport_mask{};
bool stores_tess_level_outer{}; bool stores_tess_level_outer{};
bool stores_tess_level_inner{}; bool stores_tess_level_inner{};
bool stores_indexed_attributes{}; bool stores_indexed_attributes{};
bool stores_global_memory{}; bool stores_global_memory{};
bool uses_fp16{}; bool uses_fp16{};