diff options
Diffstat (limited to 'src/shader_recompiler/backend')
6 files changed, 24 insertions, 0 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_image.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_image.cpp index 09e3a9b82..583ed3cf2 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_image.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_image.cpp | |||
| @@ -608,6 +608,14 @@ void EmitImageWrite(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, Re | |||
| 608 | ctx.Add("STOREIM.{} {},{},{},{};", format, image, color, coord, type); | 608 | ctx.Add("STOREIM.{} {},{},{},{};", format, image, color, coord, type); |
| 609 | } | 609 | } |
| 610 | 610 | ||
| 611 | void EmitIsTextureScaled(EmitContext& ctx, IR::Inst& inst, const IR::Value& index) { | ||
| 612 | if (!index.IsImmediate()) { | ||
| 613 | throw NotImplementedException("Non-constant texture rescaling"); | ||
| 614 | } | ||
| 615 | UNIMPLEMENTED(); | ||
| 616 | ctx.Add("MOV.S {}.x,-1;", inst); | ||
| 617 | } | ||
| 618 | |||
| 611 | void EmitImageAtomicIAdd32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, Register coord, | 619 | void EmitImageAtomicIAdd32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, Register coord, |
| 612 | ScalarU32 value) { | 620 | ScalarU32 value) { |
| 613 | ImageAtomic(ctx, inst, index, coord, value, "ADD.U32"); | 621 | ImageAtomic(ctx, inst, index, coord, value, "ADD.U32"); |
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_instructions.h b/src/shader_recompiler/backend/glasm/emit_glasm_instructions.h index 4f8dd8e42..e2b7d601d 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_instructions.h +++ b/src/shader_recompiler/backend/glasm/emit_glasm_instructions.h | |||
| @@ -556,6 +556,7 @@ void EmitImageGradient(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | |||
| 556 | void EmitImageRead(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, Register coord); | 556 | void EmitImageRead(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, Register coord); |
| 557 | void EmitImageWrite(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, Register coord, | 557 | void EmitImageWrite(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, Register coord, |
| 558 | Register color); | 558 | Register color); |
| 559 | void EmitIsTextureScaled(EmitContext& ctx, IR::Inst& inst, const IR::Value& index); | ||
| 559 | void EmitBindlessImageAtomicIAdd32(EmitContext&); | 560 | void EmitBindlessImageAtomicIAdd32(EmitContext&); |
| 560 | void EmitBindlessImageAtomicSMin32(EmitContext&); | 561 | void EmitBindlessImageAtomicSMin32(EmitContext&); |
| 561 | void EmitBindlessImageAtomicUMin32(EmitContext&); | 562 | void EmitBindlessImageAtomicUMin32(EmitContext&); |
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_image.cpp b/src/shader_recompiler/backend/glsl/emit_glsl_image.cpp index 447eb8e0a..099e0160b 100644 --- a/src/shader_recompiler/backend/glsl/emit_glsl_image.cpp +++ b/src/shader_recompiler/backend/glsl/emit_glsl_image.cpp | |||
| @@ -612,6 +612,14 @@ void EmitImageAtomicExchange32(EmitContext& ctx, IR::Inst& inst, const IR::Value | |||
| 612 | value); | 612 | value); |
| 613 | } | 613 | } |
| 614 | 614 | ||
| 615 | void EmitIsTextureScaled(EmitContext& ctx, IR::Inst& inst, const IR::Value& index) { | ||
| 616 | if (!index.IsImmediate()) { | ||
| 617 | throw NotImplementedException("Non-constant texture rescaling"); | ||
| 618 | } | ||
| 619 | UNIMPLEMENTED(); | ||
| 620 | ctx.AddU1("{}=true;", inst); | ||
| 621 | } | ||
| 622 | |||
| 615 | void EmitBindlessImageSampleImplicitLod(EmitContext&) { | 623 | void EmitBindlessImageSampleImplicitLod(EmitContext&) { |
| 616 | NotImplemented(); | 624 | NotImplemented(); |
| 617 | } | 625 | } |
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_instructions.h b/src/shader_recompiler/backend/glsl/emit_glsl_instructions.h index 159e4b770..f86502e4c 100644 --- a/src/shader_recompiler/backend/glsl/emit_glsl_instructions.h +++ b/src/shader_recompiler/backend/glsl/emit_glsl_instructions.h | |||
| @@ -630,6 +630,8 @@ void EmitImageRead(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | |||
| 630 | std::string_view coords); | 630 | std::string_view coords); |
| 631 | void EmitImageWrite(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, | 631 | void EmitImageWrite(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, |
| 632 | std::string_view coords, std::string_view color); | 632 | std::string_view coords, std::string_view color); |
| 633 | void EmitIsTextureScaled(EmitContext& ctx, IR::Inst& inst, const IR::Value& index); | ||
| 634 | void EmitIsImageScaled(EmitContext& ctx, IR::Inst& inst, const IR::Value& index); | ||
| 633 | void EmitBindlessImageAtomicIAdd32(EmitContext&); | 635 | void EmitBindlessImageAtomicIAdd32(EmitContext&); |
| 634 | void EmitBindlessImageAtomicSMin32(EmitContext&); | 636 | void EmitBindlessImageAtomicSMin32(EmitContext&); |
| 635 | void EmitBindlessImageAtomicUMin32(EmitContext&); | 637 | void EmitBindlessImageAtomicUMin32(EmitContext&); |
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp index 1d5364309..2f925cc3e 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp | |||
| @@ -470,4 +470,8 @@ void EmitImageWrite(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id | |||
| 470 | ctx.OpImageWrite(Image(ctx, index, info), coords, color); | 470 | ctx.OpImageWrite(Image(ctx, index, info), coords, color); |
| 471 | } | 471 | } |
| 472 | 472 | ||
| 473 | Id EmitIsTextureScaled([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] const IR::Value& index) { | ||
| 474 | return ctx.false_value; | ||
| 475 | } | ||
| 476 | |||
| 473 | } // namespace Shader::Backend::SPIRV | 477 | } // namespace Shader::Backend::SPIRV |
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_instructions.h b/src/shader_recompiler/backend/spirv/emit_spirv_instructions.h index 44eda16ca..69fc18f5f 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_instructions.h +++ b/src/shader_recompiler/backend/spirv/emit_spirv_instructions.h | |||
| @@ -513,6 +513,7 @@ Id EmitImageGradient(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, I | |||
| 513 | Id derivates, Id offset, Id lod_clamp); | 513 | Id derivates, Id offset, Id lod_clamp); |
| 514 | Id EmitImageRead(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id coords); | 514 | Id EmitImageRead(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id coords); |
| 515 | void EmitImageWrite(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id coords, Id color); | 515 | void EmitImageWrite(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id coords, Id color); |
| 516 | Id EmitIsTextureScaled(EmitContext& ctx, const IR::Value& index); | ||
| 516 | Id EmitBindlessImageAtomicIAdd32(EmitContext&); | 517 | Id EmitBindlessImageAtomicIAdd32(EmitContext&); |
| 517 | Id EmitBindlessImageAtomicSMin32(EmitContext&); | 518 | Id EmitBindlessImageAtomicSMin32(EmitContext&); |
| 518 | Id EmitBindlessImageAtomicUMin32(EmitContext&); | 519 | Id EmitBindlessImageAtomicUMin32(EmitContext&); |