2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

Merge pull request #3767 from ReinUsesLisp/point-size-pipeline

vk_pipeline_cache: Fix unintentional memcpy into optional
This commit is contained in:
Mat M 2020-04-22 21:20:14 -04:00 committed by GitHub
commit 2c806c5fd3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -330,8 +330,10 @@ VKPipelineCache::DecompileShaders(const GraphicsPipelineCacheKey& key) {
Specialization specialization; Specialization specialization;
if (fixed_state.rasterizer.Topology() == Maxwell::PrimitiveTopology::Points) { if (fixed_state.rasterizer.Topology() == Maxwell::PrimitiveTopology::Points) {
ASSERT(fixed_state.rasterizer.point_size != 0); float point_size;
std::memcpy(&specialization.point_size, &fixed_state.rasterizer.point_size, sizeof(u32)); std::memcpy(&point_size, &fixed_state.rasterizer.point_size, sizeof(float));
specialization.point_size = point_size;
ASSERT(point_size != 0.0f);
} }
for (std::size_t i = 0; i < Maxwell::NumVertexAttributes; ++i) { for (std::size_t i = 0; i < Maxwell::NumVertexAttributes; ++i) {
specialization.attribute_types[i] = fixed_state.vertex_input.attributes[i].Type(); specialization.attribute_types[i] = fixed_state.vertex_input.attributes[i].Type();