aurora: Windows compile & D3D12 fixes

This commit is contained in:
Luke Street 2022-05-03 20:26:45 -04:00
parent ad90e4b511
commit b9376280aa
3 changed files with 18 additions and 9 deletions

View File

@ -33,7 +33,9 @@ struct TevOp {
GX::TevScale scale = GX::TevScale::CS_SCALE_1;
GX::TevRegID outReg = GX::TevRegID::TEVPREV;
bool clamp = true;
u32 _pad : 24 = 0;
u8 _p1 = 0;
u8 _p2 = 0;
u8 _p3 = 0;
bool operator==(const TevOp&) const = default;
};
static_assert(std::has_unique_object_representations_v<TevOp>);
@ -69,7 +71,9 @@ struct ColorChannelConfig {
GX::ColorSrc matSrc = GX::SRC_REG;
GX::ColorSrc ambSrc = GX::SRC_REG;
bool lightingEnabled = false;
u32 _pad : 24 = 0;
u8 _p1 = 0;
u8 _p2 = 0;
u8 _p3 = 0;
bool operator==(const ColorChannelConfig&) const = default;
};
static_assert(std::has_unique_object_representations_v<ColorChannelConfig>);
@ -88,7 +92,9 @@ struct TcgConfig {
GX::TexMtx mtx = GX::IDENTITY;
GX::PTTexMtx postMtx = GX::PTIDENTITY;
bool normalize = false;
u32 _pad : 24 = 0;
u8 _p1 = 0;
u8 _p2 = 0;
u8 _p3 = 0;
bool operator==(const TcgConfig&) const = default;
};
static_assert(std::has_unique_object_representations_v<TcgConfig>);

View File

@ -688,9 +688,8 @@ wgpu::ShaderModule build_shader(const ShaderConfig& config, const ShaderInfo& in
} else if (attr >= GX::VA_TEX0 && attr <= GX::VA_TEX7) {
arrType = "vec2<f32>";
}
uniformBindings += fmt::format(
"\n@group(0) @binding({})"
"\nvar<storage, read> v_arr_{}: array<{}>;",
uniformBindings += fmt::format(FMT_STRING("\n@group(0) @binding({})"
"\nvar<storage, read> v_arr_{}: array<{}>;"),
uniBindingIdx++, attrName, arrType);
}
++currAttrIdx;

View File

@ -150,8 +150,12 @@ void initialize(SDL_Window* window) {
.limits =
{
// Use "best" supported alignments
.minUniformBufferOffsetAlignment = supportedLimits.limits.minUniformBufferOffsetAlignment,
.minStorageBufferOffsetAlignment = supportedLimits.limits.minStorageBufferOffsetAlignment,
.minUniformBufferOffsetAlignment = supportedLimits.limits.minUniformBufferOffsetAlignment == 0
? WGPU_LIMIT_U32_UNDEFINED
: supportedLimits.limits.minUniformBufferOffsetAlignment,
.minStorageBufferOffsetAlignment = supportedLimits.limits.minStorageBufferOffsetAlignment == 0
? WGPU_LIMIT_U32_UNDEFINED
: supportedLimits.limits.minStorageBufferOffsetAlignment,
},
};
const std::array<wgpu::FeatureName, 1> requiredFeatures{