mirror of
https://git.triforceproject.com/triforce/source
synced 2026-11-21 09:09:58 -04:00
Triforce v0.2.0
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
20
gpu/vk/eden/shader_recompiler/frontend/ampere/instruction.h
Normal file
20
gpu/vk/eden/shader_recompiler/frontend/ampere/instruction.h
Normal file
@@ -0,0 +1,20 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include "common/common_types.h"
|
||||
|
||||
namespace Shader::Ampere {
|
||||
struct Instruction {
|
||||
std::array<u32, 4> words;
|
||||
|
||||
u32 Bits(u32 offset, u32 count) const {
|
||||
u64 bits = words[offset / 32];
|
||||
if (offset / 32 + 1 < words.size())
|
||||
bits |= u64{words[offset / 32 + 1]} << 32;
|
||||
return static_cast<u32>((bits >> (offset % 32)) & ((u64{1} << count) - 1));
|
||||
}
|
||||
};
|
||||
static_assert(sizeof(Instruction) == 16);
|
||||
} // namespace Shader::Ampere
|
||||
Reference in New Issue
Block a user