Skip to content

Commit

Permalink
Push Constants
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacMarovitz committed Jan 1, 2025
1 parent 3f136a8 commit bfc303b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/rend/metal/metal_renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ void MetalRenderer::DrawPoly(MTL::RenderCommandEncoder *encoder, u32 listType, b
palette_index
};

// TODO: Set & Bind Push Constants
encoder->setFragmentBytes(pushConstants.data(), sizeof(pushConstants), 1);
}

encoder->setRenderPipelineState(pipelineManager.GetPipeline(listType, sortTriangles, poly, gpuPalette, dithering));
Expand Down
4 changes: 2 additions & 2 deletions core/rend/metal/metal_shaders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ float4 palette_pixel_bilinear(texture2d<float> texture, sampler texture_sampler,
return mix(temp0, temp1, weight.y);
}
fragment FragmentOut fs_main(VertexOut in [[stage_in]], constant FragmentShaderUniforms& uniforms,
constant PushBlock& push_constants,
fragment FragmentOut fs_main(VertexOut in [[stage_in]], constant FragmentShaderUniforms& uniforms [[buffer(0)]],
constant PushBlock& push_constants [[buffer(1)]],
texture2d<float> tex [[texture(0), function_constant(pp_texture)]], sampler tex_sampler [[sampler(0), function_constant(pp_texture)]],
texture2d<float> fog_table [[texture(2), function_constant(has_fog_table)]], sampler fog_table_sampler [[sampler(2), function_constant(has_fog_table)]],
texture2d<float> palette [[texture(3), function_constant(has_palette)]], sampler palette_sampler [[sampler(3), function_constant(has_palette)]])
Expand Down

0 comments on commit bfc303b

Please sign in to comment.