1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-14 22:29:15 +01:00

Make hashes use correct types and fix narrowing warnings in spirv module. (#307)

* Fix narrowing warnings in spirv_module relating to enum's default width on x64

* Make hashes of states use correct types without casting.

* Fix narrowing conversion in d3d11_sampler.cpp
This commit is contained in:
Joshua Ashton 2018-04-20 00:10:58 +01:00 committed by Philip Rebohle
parent cfd3723221
commit 90e7fe6791
3 changed files with 9 additions and 7 deletions

View File

@ -25,7 +25,7 @@ namespace dxvk {
info.mipmapLodBias = desc.MipLODBias; info.mipmapLodBias = desc.MipLODBias;
info.mipmapLodMin = desc.MinLOD; info.mipmapLodMin = desc.MinLOD;
info.mipmapLodMax = desc.MaxLOD; info.mipmapLodMax = desc.MaxLOD;
info.maxAnisotropy = desc.MaxAnisotropy; info.maxAnisotropy = static_cast<float>(desc.MaxAnisotropy);
info.addressModeU = DecodeAddressMode(desc.AddressU); info.addressModeU = DecodeAddressMode(desc.AddressU);
info.addressModeV = DecodeAddressMode(desc.AddressV); info.addressModeV = DecodeAddressMode(desc.AddressV);
info.addressModeW = DecodeAddressMode(desc.AddressW); info.addressModeW = DecodeAddressMode(desc.AddressW);

View File

@ -47,13 +47,15 @@ namespace dxvk {
size_t D3D11StateDescHash::operator () ( size_t D3D11StateDescHash::operator () (
const D3D11_RASTERIZER_DESC1& desc) const { const D3D11_RASTERIZER_DESC1& desc) const {
std::hash<float> fhash;
DxvkHashState hash; DxvkHashState hash;
hash.add(desc.FillMode); hash.add(desc.FillMode);
hash.add(desc.CullMode); hash.add(desc.CullMode);
hash.add(desc.FrontCounterClockwise); hash.add(desc.FrontCounterClockwise);
hash.add(desc.DepthBias); hash.add(desc.DepthBias);
hash.add(desc.SlopeScaledDepthBias); hash.add(fhash(desc.SlopeScaledDepthBias));
hash.add(desc.DepthBiasClamp); hash.add(fhash(desc.DepthBiasClamp));
hash.add(desc.DepthClipEnable); hash.add(desc.DepthClipEnable);
hash.add(desc.ScissorEnable); hash.add(desc.ScissorEnable);
hash.add(desc.MultisampleEnable); hash.add(desc.MultisampleEnable);
@ -90,7 +92,7 @@ namespace dxvk {
hash.add(desc.AddressV); hash.add(desc.AddressV);
hash.add(desc.AddressW); hash.add(desc.AddressW);
hash.add(fhash(desc.MipLODBias)); hash.add(fhash(desc.MipLODBias));
hash.add(fhash(desc.MaxAnisotropy)); hash.add(desc.MaxAnisotropy);
hash.add(desc.ComparisonFunc); hash.add(desc.ComparisonFunc);
for (uint32_t i = 0; i < 4; i++) for (uint32_t i = 0; i < 4; i++)
hash.add(fhash(desc.BorderColor[i])); hash.add(fhash(desc.BorderColor[i]));

View File

@ -569,7 +569,7 @@ namespace dxvk {
uint32_t variableType, uint32_t variableType,
spv::StorageClass storageClass) { spv::StorageClass storageClass) {
std::array<uint32_t, 2> args = {{ std::array<uint32_t, 2> args = {{
storageClass, static_cast<uint32_t>(storageClass),
variableType, variableType,
}}; }};
@ -593,11 +593,11 @@ namespace dxvk {
spv::ImageFormat format) { spv::ImageFormat format) {
std::array<uint32_t, 7> args = {{ std::array<uint32_t, 7> args = {{
sampledType, sampledType,
dimensionality, static_cast<uint32_t>(dimensionality),
depth, arrayed, depth, arrayed,
multisample, multisample,
sampled, sampled,
format static_cast<uint32_t>(format)
}}; }};
return this->defType(spv::OpTypeImage, return this->defType(spv::OpTypeImage,