diff options
Diffstat (limited to 'src/shader_recompiler/backend')
3 files changed, 153 insertions, 71 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_context.cpp b/src/shader_recompiler/backend/spirv/emit_context.cpp index 2885e6799..3c84e6466 100644 --- a/src/shader_recompiler/backend/spirv/emit_context.cpp +++ b/src/shader_recompiler/backend/spirv/emit_context.cpp | |||
| @@ -430,15 +430,33 @@ Id DescType(EmitContext& ctx, Id sampled_type, Id pointer_type, u32 count) { | |||
| 430 | } | 430 | } |
| 431 | } | 431 | } |
| 432 | 432 | ||
| 433 | size_t FindNextUnusedLocation(const std::bitset<IR::NUM_GENERICS>& used_locations, | 433 | size_t FindAndSetNextUnusedLocation(std::bitset<IR::NUM_GENERICS>& used_locations, |
| 434 | size_t start_offset) { | 434 | size_t& start_offset) { |
| 435 | for (size_t location = start_offset; location < used_locations.size(); ++location) { | 435 | for (size_t location = start_offset; location < used_locations.size(); ++location) { |
| 436 | if (!used_locations.test(location)) { | 436 | if (!used_locations.test(location)) { |
| 437 | start_offset = location; | ||
| 438 | used_locations.set(location); | ||
| 437 | return location; | 439 | return location; |
| 438 | } | 440 | } |
| 439 | } | 441 | } |
| 440 | throw RuntimeError("Unable to get an unused location for legacy attribute"); | 442 | throw RuntimeError("Unable to get an unused location for legacy attribute"); |
| 441 | } | 443 | } |
| 444 | |||
| 445 | Id DefineLegacyInput(EmitContext& ctx, std::bitset<IR::NUM_GENERICS>& used_locations, | ||
| 446 | size_t& start_offset) { | ||
| 447 | const Id id{DefineInput(ctx, ctx.F32[4], true)}; | ||
| 448 | const size_t location = FindAndSetNextUnusedLocation(used_locations, start_offset); | ||
| 449 | ctx.Decorate(id, spv::Decoration::Location, location); | ||
| 450 | return id; | ||
| 451 | } | ||
| 452 | |||
| 453 | Id DefineLegacyOutput(EmitContext& ctx, std::bitset<IR::NUM_GENERICS>& used_locations, | ||
| 454 | size_t& start_offset, std::optional<u32> invocations) { | ||
| 455 | const Id id{DefineOutput(ctx, ctx.F32[4], invocations)}; | ||
| 456 | const size_t location = FindAndSetNextUnusedLocation(used_locations, start_offset); | ||
| 457 | ctx.Decorate(id, spv::Decoration::Location, location); | ||
| 458 | return id; | ||
| 459 | } | ||
| 442 | } // Anonymous namespace | 460 | } // Anonymous namespace |
| 443 | 461 | ||
| 444 | void VectorTypes::Define(Sirit::Module& sirit_ctx, Id base_type, std::string_view name) { | 462 | void VectorTypes::Define(Sirit::Module& sirit_ctx, Id base_type, std::string_view name) { |
| @@ -520,6 +538,64 @@ Id EmitContext::BitOffset16(const IR::Value& offset) { | |||
| 520 | return OpBitwiseAnd(U32[1], OpShiftLeftLogical(U32[1], Def(offset), Const(3u)), Const(16u)); | 538 | return OpBitwiseAnd(U32[1], OpShiftLeftLogical(U32[1], Def(offset), Const(3u)), Const(16u)); |
| 521 | } | 539 | } |
| 522 | 540 | ||
| 541 | Id EmitContext::InputLegacyAttribute(IR::Attribute attribute) { | ||
| 542 | if (attribute >= IR::Attribute::ColorFrontDiffuseR && | ||
| 543 | attribute <= IR::Attribute::ColorFrontDiffuseA) { | ||
| 544 | return input_front_color; | ||
| 545 | } | ||
| 546 | if (attribute >= IR::Attribute::ColorFrontSpecularR && | ||
| 547 | attribute <= IR::Attribute::ColorFrontSpecularA) { | ||
| 548 | return input_front_secondary_color; | ||
| 549 | } | ||
| 550 | if (attribute >= IR::Attribute::ColorBackDiffuseR && | ||
| 551 | attribute <= IR::Attribute::ColorBackDiffuseA) { | ||
| 552 | return input_back_color; | ||
| 553 | } | ||
| 554 | if (attribute >= IR::Attribute::ColorBackSpecularR && | ||
| 555 | attribute <= IR::Attribute::ColorBackSpecularA) { | ||
| 556 | return input_back_secondary_color; | ||
| 557 | } | ||
| 558 | if (attribute == IR::Attribute::FogCoordinate) { | ||
| 559 | return input_fog_frag_coord; | ||
| 560 | } | ||
| 561 | if (attribute >= IR::Attribute::FixedFncTexture0S && | ||
| 562 | attribute <= IR::Attribute::FixedFncTexture9Q) { | ||
| 563 | u32 index = | ||
| 564 | (static_cast<u32>(attribute) - static_cast<u32>(IR::Attribute::FixedFncTexture0S)) / 4; | ||
| 565 | return input_fixed_fnc_textures[index]; | ||
| 566 | } | ||
| 567 | throw InvalidArgument("Attribute is not legacy attribute {}", attribute); | ||
| 568 | } | ||
| 569 | |||
| 570 | Id EmitContext::OutputLegacyAttribute(IR::Attribute attribute) { | ||
| 571 | if (attribute >= IR::Attribute::ColorFrontDiffuseR && | ||
| 572 | attribute <= IR::Attribute::ColorFrontDiffuseA) { | ||
| 573 | return output_front_color; | ||
| 574 | } | ||
| 575 | if (attribute >= IR::Attribute::ColorFrontSpecularR && | ||
| 576 | attribute <= IR::Attribute::ColorFrontSpecularA) { | ||
| 577 | return output_front_secondary_color; | ||
| 578 | } | ||
| 579 | if (attribute >= IR::Attribute::ColorBackDiffuseR && | ||
| 580 | attribute <= IR::Attribute::ColorBackDiffuseA) { | ||
| 581 | return output_back_color; | ||
| 582 | } | ||
| 583 | if (attribute >= IR::Attribute::ColorBackSpecularR && | ||
| 584 | attribute <= IR::Attribute::ColorBackSpecularA) { | ||
| 585 | return output_back_secondary_color; | ||
| 586 | } | ||
| 587 | if (attribute == IR::Attribute::FogCoordinate) { | ||
| 588 | return output_fog_frag_coord; | ||
| 589 | } | ||
| 590 | if (attribute >= IR::Attribute::FixedFncTexture0S && | ||
| 591 | attribute <= IR::Attribute::FixedFncTexture9Q) { | ||
| 592 | u32 index = | ||
| 593 | (static_cast<u32>(attribute) - static_cast<u32>(IR::Attribute::FixedFncTexture0S)) / 4; | ||
| 594 | return output_fixed_fnc_textures[index]; | ||
| 595 | } | ||
| 596 | throw InvalidArgument("Attribute is not legacy attribute {}", attribute); | ||
| 597 | } | ||
| 598 | |||
| 523 | void EmitContext::DefineCommonTypes(const Info& info) { | 599 | void EmitContext::DefineCommonTypes(const Info& info) { |
| 524 | void_id = TypeVoid(); | 600 | void_id = TypeVoid(); |
| 525 | 601 | ||
| @@ -1279,22 +1355,26 @@ void EmitContext::DefineInputs(const IR::Program& program) { | |||
| 1279 | } | 1355 | } |
| 1280 | size_t previous_unused_location = 0; | 1356 | size_t previous_unused_location = 0; |
| 1281 | if (loads.AnyComponent(IR::Attribute::ColorFrontDiffuseR)) { | 1357 | if (loads.AnyComponent(IR::Attribute::ColorFrontDiffuseR)) { |
| 1282 | const size_t location = FindNextUnusedLocation(used_locations, previous_unused_location); | 1358 | input_front_color = DefineLegacyInput(*this, used_locations, previous_unused_location); |
| 1283 | previous_unused_location = location; | 1359 | } |
| 1284 | used_locations.set(location); | 1360 | if (loads.AnyComponent(IR::Attribute::ColorFrontSpecularR)) { |
| 1285 | const Id id{DefineInput(*this, F32[4], true)}; | 1361 | input_front_secondary_color = |
| 1286 | Decorate(id, spv::Decoration::Location, location); | 1362 | DefineLegacyInput(*this, used_locations, previous_unused_location); |
| 1287 | input_front_color = id; | 1363 | } |
| 1364 | if (loads.AnyComponent(IR::Attribute::ColorBackDiffuseR)) { | ||
| 1365 | input_back_color = DefineLegacyInput(*this, used_locations, previous_unused_location); | ||
| 1366 | } | ||
| 1367 | if (loads.AnyComponent(IR::Attribute::ColorBackSpecularR)) { | ||
| 1368 | input_back_secondary_color = | ||
| 1369 | DefineLegacyInput(*this, used_locations, previous_unused_location); | ||
| 1370 | } | ||
| 1371 | if (loads.AnyComponent(IR::Attribute::FogCoordinate)) { | ||
| 1372 | input_fog_frag_coord = DefineLegacyInput(*this, used_locations, previous_unused_location); | ||
| 1288 | } | 1373 | } |
| 1289 | for (size_t index = 0; index < NUM_FIXEDFNCTEXTURE; ++index) { | 1374 | for (size_t index = 0; index < NUM_FIXEDFNCTEXTURE; ++index) { |
| 1290 | if (loads.AnyComponent(IR::Attribute::FixedFncTexture0S + index * 4)) { | 1375 | if (loads.AnyComponent(IR::Attribute::FixedFncTexture0S + index * 4)) { |
| 1291 | const size_t location = | 1376 | input_fixed_fnc_textures[index] = |
| 1292 | FindNextUnusedLocation(used_locations, previous_unused_location); | 1377 | DefineLegacyInput(*this, used_locations, previous_unused_location); |
| 1293 | previous_unused_location = location; | ||
| 1294 | used_locations.set(location); | ||
| 1295 | const Id id{DefineInput(*this, F32[4], true)}; | ||
| 1296 | Decorate(id, spv::Decoration::Location, location); | ||
| 1297 | input_fixed_fnc_textures[index] = id; | ||
| 1298 | } | 1378 | } |
| 1299 | } | 1379 | } |
| 1300 | if (stage == Stage::TessellationEval) { | 1380 | if (stage == Stage::TessellationEval) { |
| @@ -1356,22 +1436,29 @@ void EmitContext::DefineOutputs(const IR::Program& program) { | |||
| 1356 | } | 1436 | } |
| 1357 | size_t previous_unused_location = 0; | 1437 | size_t previous_unused_location = 0; |
| 1358 | if (info.stores.AnyComponent(IR::Attribute::ColorFrontDiffuseR)) { | 1438 | if (info.stores.AnyComponent(IR::Attribute::ColorFrontDiffuseR)) { |
| 1359 | const size_t location = FindNextUnusedLocation(used_locations, previous_unused_location); | 1439 | output_front_color = |
| 1360 | previous_unused_location = location; | 1440 | DefineLegacyOutput(*this, used_locations, previous_unused_location, invocations); |
| 1361 | used_locations.set(location); | 1441 | } |
| 1362 | const Id id{DefineOutput(*this, F32[4], invocations)}; | 1442 | if (info.stores.AnyComponent(IR::Attribute::ColorFrontSpecularR)) { |
| 1363 | Decorate(id, spv::Decoration::Location, static_cast<u32>(location)); | 1443 | output_front_secondary_color = |
| 1364 | output_front_color = id; | 1444 | DefineLegacyOutput(*this, used_locations, previous_unused_location, invocations); |
| 1445 | } | ||
| 1446 | if (info.stores.AnyComponent(IR::Attribute::ColorBackDiffuseR)) { | ||
| 1447 | output_back_color = | ||
| 1448 | DefineLegacyOutput(*this, used_locations, previous_unused_location, invocations); | ||
| 1449 | } | ||
| 1450 | if (info.stores.AnyComponent(IR::Attribute::ColorBackSpecularR)) { | ||
| 1451 | output_back_secondary_color = | ||
| 1452 | DefineLegacyOutput(*this, used_locations, previous_unused_location, invocations); | ||
| 1453 | } | ||
| 1454 | if (info.stores.AnyComponent(IR::Attribute::FogCoordinate)) { | ||
| 1455 | output_fog_frag_coord = | ||
| 1456 | DefineLegacyOutput(*this, used_locations, previous_unused_location, invocations); | ||
| 1365 | } | 1457 | } |
| 1366 | for (size_t index = 0; index < NUM_FIXEDFNCTEXTURE; ++index) { | 1458 | for (size_t index = 0; index < NUM_FIXEDFNCTEXTURE; ++index) { |
| 1367 | if (info.stores.AnyComponent(IR::Attribute::FixedFncTexture0S + index * 4)) { | 1459 | if (info.stores.AnyComponent(IR::Attribute::FixedFncTexture0S + index * 4)) { |
| 1368 | const size_t location = | 1460 | output_fixed_fnc_textures[index] = |
| 1369 | FindNextUnusedLocation(used_locations, previous_unused_location); | 1461 | DefineLegacyOutput(*this, used_locations, previous_unused_location, invocations); |
| 1370 | previous_unused_location = location; | ||
| 1371 | used_locations.set(location); | ||
| 1372 | const Id id{DefineOutput(*this, F32[4], invocations)}; | ||
| 1373 | Decorate(id, spv::Decoration::Location, location); | ||
| 1374 | output_fixed_fnc_textures[index] = id; | ||
| 1375 | } | 1462 | } |
| 1376 | } | 1463 | } |
| 1377 | switch (stage) { | 1464 | switch (stage) { |
diff --git a/src/shader_recompiler/backend/spirv/emit_context.h b/src/shader_recompiler/backend/spirv/emit_context.h index 847d0c0e6..112c52382 100644 --- a/src/shader_recompiler/backend/spirv/emit_context.h +++ b/src/shader_recompiler/backend/spirv/emit_context.h | |||
| @@ -113,6 +113,9 @@ public: | |||
| 113 | [[nodiscard]] Id BitOffset8(const IR::Value& offset); | 113 | [[nodiscard]] Id BitOffset8(const IR::Value& offset); |
| 114 | [[nodiscard]] Id BitOffset16(const IR::Value& offset); | 114 | [[nodiscard]] Id BitOffset16(const IR::Value& offset); |
| 115 | 115 | ||
| 116 | Id InputLegacyAttribute(IR::Attribute attribute); | ||
| 117 | Id OutputLegacyAttribute(IR::Attribute attribute); | ||
| 118 | |||
| 116 | Id Const(u32 value) { | 119 | Id Const(u32 value) { |
| 117 | return Constant(U32[1], value); | 120 | return Constant(U32[1], value); |
| 118 | } | 121 | } |
| @@ -269,12 +272,20 @@ public: | |||
| 269 | 272 | ||
| 270 | Id input_position{}; | 273 | Id input_position{}; |
| 271 | Id input_front_color{}; | 274 | Id input_front_color{}; |
| 275 | Id input_front_secondary_color{}; | ||
| 276 | Id input_back_color{}; | ||
| 277 | Id input_back_secondary_color{}; | ||
| 278 | Id input_fog_frag_coord{}; | ||
| 272 | std::array<Id, 10> input_fixed_fnc_textures{}; | 279 | std::array<Id, 10> input_fixed_fnc_textures{}; |
| 273 | std::array<Id, 32> input_generics{}; | 280 | std::array<Id, 32> input_generics{}; |
| 274 | 281 | ||
| 275 | Id output_point_size{}; | 282 | Id output_point_size{}; |
| 276 | Id output_position{}; | 283 | Id output_position{}; |
| 277 | Id output_front_color{}; | 284 | Id output_front_color{}; |
| 285 | Id output_front_secondary_color{}; | ||
| 286 | Id output_back_color{}; | ||
| 287 | Id output_back_secondary_color{}; | ||
| 288 | Id output_fog_frag_coord{}; | ||
| 278 | std::array<Id, 10> output_fixed_fnc_textures{}; | 289 | std::array<Id, 10> output_fixed_fnc_textures{}; |
| 279 | std::array<std::array<GenericElementInfo, 4>, 32> output_generics{}; | 290 | std::array<std::array<GenericElementInfo, 4>, 32> output_generics{}; |
| 280 | 291 | ||
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp index 6f60c6574..d3a93d5f4 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp | |||
| @@ -43,23 +43,12 @@ Id AttrPointer(EmitContext& ctx, Id pointer_type, Id vertex, Id base, Args&&... | |||
| 43 | } | 43 | } |
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | bool IsFixedFncTexture(IR::Attribute attribute) { | 46 | bool IsLegacyAttribute(IR::Attribute attribute) { |
| 47 | return attribute >= IR::Attribute::FixedFncTexture0S && | 47 | return (attribute >= IR::Attribute::ColorFrontDiffuseR && |
| 48 | attribute <= IR::Attribute::FixedFncTexture9Q; | 48 | attribute <= IR::Attribute::ColorBackSpecularA) || |
| 49 | } | 49 | attribute == IR::Attribute::FogCoordinate || |
| 50 | 50 | (attribute >= IR::Attribute::FixedFncTexture0S && | |
| 51 | u32 FixedFncTextureAttributeIndex(IR::Attribute attribute) { | 51 | attribute <= IR::Attribute::FixedFncTexture9Q); |
| 52 | if (!IsFixedFncTexture(attribute)) { | ||
| 53 | throw InvalidArgument("Attribute {} is not a FixedFncTexture", attribute); | ||
| 54 | } | ||
| 55 | return (static_cast<u32>(attribute) - static_cast<u32>(IR::Attribute::FixedFncTexture0S)) / 4u; | ||
| 56 | } | ||
| 57 | |||
| 58 | u32 FixedFncTextureAttributeElement(IR::Attribute attribute) { | ||
| 59 | if (!IsFixedFncTexture(attribute)) { | ||
| 60 | throw InvalidArgument("Attribute {} is not a FixedFncTexture", attribute); | ||
| 61 | } | ||
| 62 | return static_cast<u32>(attribute) % 4u; | ||
| 63 | } | 52 | } |
| 64 | 53 | ||
| 65 | template <typename... Args> | 54 | template <typename... Args> |
| @@ -93,12 +82,16 @@ std::optional<OutAttr> OutputAttrPointer(EmitContext& ctx, IR::Attribute attr) { | |||
| 93 | return OutputAccessChain(ctx, ctx.output_f32, info.id, index_id); | 82 | return OutputAccessChain(ctx, ctx.output_f32, info.id, index_id); |
| 94 | } | 83 | } |
| 95 | } | 84 | } |
| 96 | if (IsFixedFncTexture(attr)) { | 85 | if (IsLegacyAttribute(attr)) { |
| 97 | const u32 index{FixedFncTextureAttributeIndex(attr)}; | 86 | if (attr == IR::Attribute::FogCoordinate) { |
| 98 | const u32 element{FixedFncTextureAttributeElement(attr)}; | 87 | return OutputAccessChain(ctx, ctx.output_f32, ctx.OutputLegacyAttribute(attr), |
| 99 | const Id element_id{ctx.Const(element)}; | 88 | ctx.Const(0u)); |
| 100 | return OutputAccessChain(ctx, ctx.output_f32, ctx.output_fixed_fnc_textures[index], | 89 | } else { |
| 101 | element_id); | 90 | const u32 element{static_cast<u32>(attr) % 4}; |
| 91 | const Id element_id{ctx.Const(element)}; | ||
| 92 | return OutputAccessChain(ctx, ctx.output_f32, ctx.OutputLegacyAttribute(attr), | ||
| 93 | element_id); | ||
| 94 | } | ||
| 102 | } | 95 | } |
| 103 | switch (attr) { | 96 | switch (attr) { |
| 104 | case IR::Attribute::PointSize: | 97 | case IR::Attribute::PointSize: |
| @@ -111,14 +104,6 @@ std::optional<OutAttr> OutputAttrPointer(EmitContext& ctx, IR::Attribute attr) { | |||
| 111 | const Id element_id{ctx.Const(element)}; | 104 | const Id element_id{ctx.Const(element)}; |
| 112 | return OutputAccessChain(ctx, ctx.output_f32, ctx.output_position, element_id); | 105 | return OutputAccessChain(ctx, ctx.output_f32, ctx.output_position, element_id); |
| 113 | } | 106 | } |
| 114 | case IR::Attribute::ColorFrontDiffuseR: | ||
| 115 | case IR::Attribute::ColorFrontDiffuseG: | ||
| 116 | case IR::Attribute::ColorFrontDiffuseB: | ||
| 117 | case IR::Attribute::ColorFrontDiffuseA: { | ||
| 118 | const u32 element{static_cast<u32>(attr) % 4}; | ||
| 119 | const Id element_id{ctx.Const(element)}; | ||
| 120 | return OutputAccessChain(ctx, ctx.output_f32, ctx.output_front_color, element_id); | ||
| 121 | } | ||
| 122 | case IR::Attribute::ClipDistance0: | 107 | case IR::Attribute::ClipDistance0: |
| 123 | case IR::Attribute::ClipDistance1: | 108 | case IR::Attribute::ClipDistance1: |
| 124 | case IR::Attribute::ClipDistance2: | 109 | case IR::Attribute::ClipDistance2: |
| @@ -341,11 +326,17 @@ Id EmitGetAttribute(EmitContext& ctx, IR::Attribute attr, Id vertex) { | |||
| 341 | const Id value{ctx.OpLoad(type->id, pointer)}; | 326 | const Id value{ctx.OpLoad(type->id, pointer)}; |
| 342 | return type->needs_cast ? ctx.OpBitcast(ctx.F32[1], value) : value; | 327 | return type->needs_cast ? ctx.OpBitcast(ctx.F32[1], value) : value; |
| 343 | } | 328 | } |
| 344 | if (IsFixedFncTexture(attr)) { | 329 | if (IsLegacyAttribute(attr)) { |
| 345 | const u32 index{FixedFncTextureAttributeIndex(attr)}; | 330 | if (attr == IR::Attribute::FogCoordinate) { |
| 346 | const Id attr_id{ctx.input_fixed_fnc_textures[index]}; | 331 | const Id attr_ptr{AttrPointer(ctx, ctx.input_f32, vertex, |
| 347 | const Id attr_ptr{AttrPointer(ctx, ctx.input_f32, vertex, attr_id, ctx.Const(element))}; | 332 | ctx.InputLegacyAttribute(attr), ctx.Const(0u))}; |
| 348 | return ctx.OpLoad(ctx.F32[1], attr_ptr); | 333 | return ctx.OpLoad(ctx.F32[1], attr_ptr); |
| 334 | } else { | ||
| 335 | const Id element_id{ctx.Const(element)}; | ||
| 336 | const Id attr_ptr{AttrPointer(ctx, ctx.input_f32, vertex, | ||
| 337 | ctx.InputLegacyAttribute(attr), element_id)}; | ||
| 338 | return ctx.OpLoad(ctx.F32[1], attr_ptr); | ||
| 339 | } | ||
| 349 | } | 340 | } |
| 350 | switch (attr) { | 341 | switch (attr) { |
| 351 | case IR::Attribute::PrimitiveId: | 342 | case IR::Attribute::PrimitiveId: |
| @@ -356,13 +347,6 @@ Id EmitGetAttribute(EmitContext& ctx, IR::Attribute attr, Id vertex) { | |||
| 356 | case IR::Attribute::PositionW: | 347 | case IR::Attribute::PositionW: |
| 357 | return ctx.OpLoad(ctx.F32[1], AttrPointer(ctx, ctx.input_f32, vertex, ctx.input_position, | 348 | return ctx.OpLoad(ctx.F32[1], AttrPointer(ctx, ctx.input_f32, vertex, ctx.input_position, |
| 358 | ctx.Const(element))); | 349 | ctx.Const(element))); |
| 359 | case IR::Attribute::ColorFrontDiffuseR: | ||
| 360 | case IR::Attribute::ColorFrontDiffuseG: | ||
| 361 | case IR::Attribute::ColorFrontDiffuseB: | ||
| 362 | case IR::Attribute::ColorFrontDiffuseA: { | ||
| 363 | return ctx.OpLoad(ctx.F32[1], AttrPointer(ctx, ctx.input_f32, vertex, ctx.input_front_color, | ||
| 364 | ctx.Const(element))); | ||
| 365 | } | ||
| 366 | case IR::Attribute::InstanceId: | 350 | case IR::Attribute::InstanceId: |
| 367 | if (ctx.profile.support_vertex_instance_id) { | 351 | if (ctx.profile.support_vertex_instance_id) { |
| 368 | return ctx.OpBitcast(ctx.F32[1], ctx.OpLoad(ctx.U32[1], ctx.instance_id)); | 352 | return ctx.OpBitcast(ctx.F32[1], ctx.OpLoad(ctx.U32[1], ctx.instance_id)); |