Skip to content

Commit cf1a4f5

Browse files
egdanielSkia Commit-Bot
authored andcommitted
Fix sksl spirv subpassLoad.
Bug: skia:10409 Change-Id: If8fba41470eddc72b397f46e4e0bb7bd7f4a3d5d Reviewed-on: https://skia-review.googlesource.com/c/skia/+/315651 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
1 parent 27e7f77 commit cf1a4f5

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/sksl/SkSLSPIRVCodeGenerator.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -851,9 +851,9 @@ SpvId SPIRVCodeGenerator::writeSpecialIntrinsic(const FunctionCall& c, SpecialIn
851851
case kSubpassLoad_SpecialIntrinsic: {
852852
SpvId img = this->writeExpression(*c.fArguments[0], out);
853853
std::vector<std::unique_ptr<Expression>> args;
854-
args.emplace_back(new FloatLiteral(fContext, -1, 0.0));
855-
args.emplace_back(new FloatLiteral(fContext, -1, 0.0));
856-
Constructor ctor(-1, *fContext.fFloat2_Type, std::move(args));
854+
args.emplace_back(new IntLiteral(fContext, -1, 0));
855+
args.emplace_back(new IntLiteral(fContext, -1, 0));
856+
Constructor ctor(-1, *fContext.fInt2_Type, std::move(args));
857857
SpvId coords = this->writeConstantVector(ctor);
858858
if (1 == c.fArguments.size()) {
859859
this->writeInstruction(SpvOpImageRead,

src/sksl/generated/sksl_gpu.dehydrated.sksl

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/sksl/sksl_gpu.sksl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,8 @@ half4 sample($gsampler2DRect sampler, float3 P);
252252

253253
// Currently we do not support the generic types of loading subpassInput so we have some explicit
254254
// versions that we currently use
255-
float4 subpassLoad(subpassInput subpass);
256-
float4 subpassLoad(subpassInputMS subpass, int sample);
255+
half4 subpassLoad(subpassInput subpass);
256+
half4 subpassLoad(subpassInputMS subpass, int sample);
257257

258258
half4 sample($gsampler1D sampler, float2 P);
259259
half4 sample($gsampler1D sampler, float2 P, float bias);

0 commit comments

Comments
 (0)