diff options
| author | 2021-03-28 19:47:52 +0200 | |
|---|---|---|
| committer | 2021-07-22 21:51:25 -0400 | |
| commit | 613b48c4a2ce71a0d0eaba17fe164f4a2e4a3db5 (patch) | |
| tree | a8d2d2eb8284f1b35184e4ee07e25709ecce0596 /src/shader_recompiler/backend/spirv/emit_spirv_image.cpp | |
| parent | shader: Implement TLDS (diff) | |
| download | yuzu-613b48c4a2ce71a0d0eaba17fe164f4a2e4a3db5.tar.gz yuzu-613b48c4a2ce71a0d0eaba17fe164f4a2e4a3db5.tar.xz yuzu-613b48c4a2ce71a0d0eaba17fe164f4a2e4a3db5.zip | |
shader,spirv: Implement ImageQueryLod.
Diffstat (limited to 'src/shader_recompiler/backend/spirv/emit_spirv_image.cpp')
| -rw-r--r-- | src/shader_recompiler/backend/spirv/emit_spirv_image.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp index 310cc7af7..2cd6b38c4 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp | |||
| @@ -161,6 +161,10 @@ Id EmitBindlessImageQueryDimensions(EmitContext&) { | |||
| 161 | throw LogicError("Unreachable instruction"); | 161 | throw LogicError("Unreachable instruction"); |
| 162 | } | 162 | } |
| 163 | 163 | ||
| 164 | Id EmitBindlessImageQueryLod(EmitContext&) { | ||
| 165 | throw LogicError("Unreachable instruction"); | ||
| 166 | } | ||
| 167 | |||
| 164 | Id EmitBoundImageSampleImplicitLod(EmitContext&) { | 168 | Id EmitBoundImageSampleImplicitLod(EmitContext&) { |
| 165 | throw LogicError("Unreachable instruction"); | 169 | throw LogicError("Unreachable instruction"); |
| 166 | } | 170 | } |
| @@ -193,6 +197,10 @@ Id EmitBoundImageQueryDimensions(EmitContext&) { | |||
| 193 | throw LogicError("Unreachable instruction"); | 197 | throw LogicError("Unreachable instruction"); |
| 194 | } | 198 | } |
| 195 | 199 | ||
| 200 | Id EmitBoundImageQueryLod(EmitContext&) { | ||
| 201 | throw LogicError("Unreachable instruction"); | ||
| 202 | } | ||
| 203 | |||
| 196 | Id EmitImageSampleImplicitLod(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id coords, | 204 | Id EmitImageSampleImplicitLod(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id coords, |
| 197 | Id bias_lc, Id offset) { | 205 | Id bias_lc, Id offset) { |
| 198 | const auto info{inst->Flags<IR::TextureInstInfo>()}; | 206 | const auto info{inst->Flags<IR::TextureInstInfo>()}; |
| @@ -287,4 +295,11 @@ Id EmitImageQueryDimensions(EmitContext& ctx, IR::Inst* inst, const IR::Value& i | |||
| 287 | throw LogicError("Unspecified image type {}", info.type.Value()); | 295 | throw LogicError("Unspecified image type {}", info.type.Value()); |
| 288 | } | 296 | } |
| 289 | 297 | ||
| 298 | Id EmitImageQueryLod(EmitContext& ctx, IR::Inst*, const IR::Value& index, Id coords) { | ||
| 299 | const Id zero{ctx.f32_zero_value}; | ||
| 300 | const Id image{TextureImage(ctx, index)}; | ||
| 301 | return ctx.OpCompositeConstruct(ctx.F32[4], ctx.OpImageQueryLod(ctx.F32[2], image, coords), | ||
| 302 | zero, zero); | ||
| 303 | } | ||
| 304 | |||
| 290 | } // namespace Shader::Backend::SPIRV | 305 | } // namespace Shader::Backend::SPIRV |