Skip to content

Commit 41243ad

Browse files
Merge pull request #31 from pythonlover02/next
Merge fixes and backports from next [3/1/2026]
2 parents 71e58e8 + eeb773d commit 41243ad

4 files changed

Lines changed: 34 additions & 36 deletions

File tree

src/d3d9/d3d9_device.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1674,10 +1674,10 @@ namespace dxvk {
16741674
HRESULT STDMETHODCALLTYPE D3D9DeviceEx::MultiplyTransform(D3DTRANSFORMSTATETYPE TransformState, const D3DMATRIX* pMatrix) {
16751675
D3D9DeviceLock lock = LockDevice();
16761676

1677-
if (unlikely(ShouldRecord()))
1678-
return m_recorder->MultiplyStateTransform(TransformState, pMatrix);
1677+
const uint32_t idx = GetTransformIndex(TransformState);
16791678

1680-
uint32_t idx = GetTransformIndex(TransformState);
1679+
if (unlikely(ShouldRecord()))
1680+
return m_recorder->MultiplyStateTransform(idx, pMatrix);
16811681

16821682
m_state.transforms[idx] = m_state.transforms[idx] * ConvertMatrix(pMatrix);
16831683

@@ -4263,8 +4263,8 @@ namespace dxvk {
42634263
info.stages = VK_PIPELINE_STAGE_VERTEX_INPUT_BIT;
42644264
} else {
42654265
info.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT;
4266-
info.stages = VK_PIPELINE_STAGE_TRANSFER_BIT;
4267-
info.access = VK_ACCESS_TRANSFER_READ_BIT;
4266+
info.stages = VK_PIPELINE_STAGE_TRANSFER_BIT | VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT;
4267+
info.access = VK_ACCESS_TRANSFER_READ_BIT | VK_ACCESS_SHADER_READ_BIT;
42684268
}
42694269

42704270
D3D9BufferSlice result;

src/d3d9/d3d9_fixed_function.cpp

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ namespace dxvk {
117117

118118
for (uint32_t i = 0; i < fogCaseLabels.size(); i++) {
119119
spvModule.opLabel(fogCaseLabels[i].labelId);
120-
120+
121121
fogVariables[i].labelId = fogCaseLabels[i].labelId;
122122
fogVariables[i].varId = [&] {
123123
auto mode = D3DFOGMODE(fogCaseLabels[i].literal);
@@ -158,7 +158,7 @@ namespace dxvk {
158158
}
159159
}
160160
}();
161-
161+
162162
spvModule.opBranch(applyFogFactor);
163163
}
164164

@@ -223,7 +223,7 @@ namespace dxvk {
223223
uint32_t rsBlock = spvModule.newVar(
224224
spvModule.defPointerType(rsStruct, spv::StorageClassPushConstant),
225225
spv::StorageClassPushConstant);
226-
226+
227227
spvModule.setDebugName (rsBlock, "render_state");
228228

229229
spvModule.setDebugName (rsStruct, "render_state_t");
@@ -431,7 +431,7 @@ namespace dxvk {
431431
NormalMatrix,
432432
InverseViewMatrix,
433433
ProjMatrix,
434-
434+
435435
Texcoord0,
436436
Texcoord1,
437437
Texcoord2,
@@ -722,7 +722,7 @@ namespace dxvk {
722722
info.inputMask = m_inputMask;
723723
info.outputMask = m_outputMask;
724724
info.pushConstOffset = m_pushConstOffset;
725-
info.pushConstSize = m_pushConstOffset;
725+
info.pushConstSize = m_pushConstSize;
726726

727727
return new DxvkShader(info, m_module.compile());
728728
}
@@ -894,7 +894,7 @@ namespace dxvk {
894894
normal = m_module.opNormalize(m_vec3Type, normal);
895895
normal = m_module.opSelect(m_vec3Type, isZeroNormal3, m_module.constvec3f32(0.0f, 0.0f, 0.0f), normal);
896896
}
897-
897+
898898
gl_Position = emitVectorTimesMatrix(4, 4, vtx, m_vs.constants.proj);
899899
} else {
900900
gl_Position = m_module.opFMul(m_vec4Type, gl_Position, m_vs.constants.invExtent);
@@ -955,7 +955,7 @@ namespace dxvk {
955955
case (DXVK_TSS_TCI_CAMERASPACEREFLECTIONVECTOR >> TCIOffset): {
956956
uint32_t vtx3 = m_module.opVectorShuffle(m_vec3Type, vtx, vtx, 3, indices.data());
957957
vtx3 = m_module.opNormalize(m_vec3Type, vtx3);
958-
958+
959959
uint32_t reflection = m_module.opReflect(m_vec3Type, vtx3, normal);
960960

961961
std::array<uint32_t, 4> transformIndices;
@@ -1146,7 +1146,7 @@ namespace dxvk {
11461146
uint32_t mat_ambient = PickSource(m_vsKey.Data.Contents.AmbientSource, m_vs.constants.materialAmbient);
11471147
uint32_t mat_emissive = PickSource(m_vsKey.Data.Contents.EmissiveSource, m_vs.constants.materialEmissive);
11481148
uint32_t mat_specular = PickSource(m_vsKey.Data.Contents.SpecularSource, m_vs.constants.materialSpecular);
1149-
1149+
11501150
std::array<uint32_t, 4> alphaSwizzle = {0, 1, 2, 7};
11511151
uint32_t finalColor0 = m_module.opFFma(m_vec4Type, mat_ambient, m_vs.constants.globalAmbient, mat_emissive);
11521152
finalColor0 = m_module.opFFma(m_vec4Type, mat_ambient, ambientValue, finalColor0);
@@ -1566,7 +1566,7 @@ namespace dxvk {
15661566
uint32_t current = diffuse;
15671567
// Temp starts off as equal to vec4(0)
15681568
uint32_t temp = m_module.constvec4f32(0.0f, 0.0f, 0.0f, 0.0f);
1569-
1569+
15701570
uint32_t texture = m_module.constvec4f32(0.0f, 0.0f, 0.0f, 1.0f);
15711571

15721572
for (uint32_t i = 0; i < caps::TextureStageCount; i++) {
@@ -1675,7 +1675,7 @@ namespace dxvk {
16751675
uint32_t lOffset = m_module.opAccessChain(m_module.defPointerType(m_floatType, spv::StorageClassUniform),
16761676
m_ps.sharedState, 1, &index);
16771677
lOffset = m_module.opLoad(m_floatType, lOffset);
1678-
1678+
16791679
uint32_t zIndex = 2;
16801680
uint32_t scale = m_module.opCompositeExtract(m_floatType, texture, 1, &zIndex);
16811681
scale = m_module.opFMul(m_floatType, scale, lScale);
@@ -2167,40 +2167,40 @@ namespace dxvk {
21672167
uint32_t worldPos = emitMatrixTimesVector(4, 4, m_vs.constants.inverseView, vtx);
21682168

21692169
uint32_t clipPlaneCountId = m_module.constu32(caps::MaxClipPlanes);
2170-
2170+
21712171
uint32_t floatType = m_module.defFloatType(32);
21722172
uint32_t vec4Type = m_module.defVectorType(floatType, 4);
2173-
2173+
21742174
// Declare uniform buffer containing clip planes
21752175
uint32_t clipPlaneArray = m_module.defArrayTypeUnique(vec4Type, clipPlaneCountId);
21762176
uint32_t clipPlaneStruct = m_module.defStructTypeUnique(1, &clipPlaneArray);
21772177
uint32_t clipPlaneBlock = m_module.newVar(
21782178
m_module.defPointerType(clipPlaneStruct, spv::StorageClassUniform),
21792179
spv::StorageClassUniform);
2180-
2180+
21812181
m_module.decorateArrayStride (clipPlaneArray, 16);
2182-
2182+
21832183
m_module.setDebugName (clipPlaneStruct, "clip_info_t");
21842184
m_module.setDebugMemberName (clipPlaneStruct, 0, "clip_planes");
21852185
m_module.decorate (clipPlaneStruct, spv::DecorationBlock);
21862186
m_module.memberDecorateOffset (clipPlaneStruct, 0, 0);
2187-
2187+
21882188
uint32_t bindingId = computeResourceSlotId(
21892189
DxsoProgramType::VertexShader,
21902190
DxsoBindingType::ConstantBuffer,
21912191
DxsoConstantBuffers::VSClipPlanes);
2192-
2192+
21932193
m_module.setDebugName (clipPlaneBlock, "clip_info");
21942194
m_module.decorateDescriptorSet(clipPlaneBlock, 0);
21952195
m_module.decorateBinding (clipPlaneBlock, bindingId);
2196-
2196+
21972197
DxvkResourceSlot resource;
21982198
resource.slot = bindingId;
21992199
resource.type = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER;
22002200
resource.view = VK_IMAGE_VIEW_TYPE_MAX_ENUM;
22012201
resource.access = VK_ACCESS_UNIFORM_READ_BIT;
22022202
m_resourceSlots.push_back(resource);
2203-
2203+
22042204
// Declare output array for clip distances
22052205
uint32_t clipDistArray = m_module.newVar(
22062206
m_module.defPointerType(
@@ -2217,14 +2217,14 @@ namespace dxvk {
22172217
m_module.constu32(0),
22182218
m_module.constu32(i),
22192219
}};
2220-
2220+
22212221
uint32_t planeId = m_module.opLoad(vec4Type,
22222222
m_module.opAccessChain(
22232223
m_module.defPointerType(vec4Type, spv::StorageClassUniform),
22242224
clipPlaneBlock, blockMembers.size(), blockMembers.data()));
2225-
2225+
22262226
uint32_t distId = m_module.opDot(floatType, worldPos, planeId);
2227-
2227+
22282228
m_module.opStore(
22292229
m_module.opAccessChain(
22302230
m_module.defPointerType(floatType, spv::StorageClassOutput),
@@ -2420,7 +2420,7 @@ namespace dxvk {
24202420
std::ofstream dumpStream(
24212421
str::tows(str::format(dumpPath, "/", Name, ".spv").c_str()).c_str(),
24222422
std::ios_base::binary | std::ios_base::trunc);
2423-
2423+
24242424
m_shader->dump(dumpStream);
24252425
}
24262426
}
@@ -2433,7 +2433,7 @@ namespace dxvk {
24332433
auto entry = m_vsModules.find(ShaderKey);
24342434
if (entry != m_vsModules.end())
24352435
return entry->second;
2436-
2436+
24372437
D3D9FFShader shader(
24382438
pDevice, ShaderKey);
24392439

@@ -2450,7 +2450,7 @@ namespace dxvk {
24502450
auto entry = m_fsModules.find(ShaderKey);
24512451
if (entry != m_fsModules.end())
24522452
return entry->second;
2453-
2453+
24542454
D3D9FFShader shader(
24552455
pDevice, ShaderKey);
24562456

src/d3d9/d3d9_format_helpers.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,7 @@ namespace dxvk {
9898
bufferViewInfo.rangeLength = srcSlice.length();
9999
auto tmpBufferView = m_device->createBufferView(srcSlice.buffer(), bufferViewInfo);
100100

101-
if (specConstantValue)
102-
m_context->setSpecConstant(VK_PIPELINE_BIND_POINT_COMPUTE, 0, specConstantValue);
103-
101+
m_context->setSpecConstant(VK_PIPELINE_BIND_POINT_COMPUTE, 0, specConstantValue);
104102
m_context->bindResourceView(BindingIds::Image, tmpImageView, nullptr);
105103
m_context->bindResourceView(BindingIds::Buffer, nullptr, tmpBufferView);
106104
m_context->bindShader(VK_SHADER_STAGE_COMPUTE_BIT, m_shaders[videoFormat.FormatType]);
@@ -113,7 +111,7 @@ namespace dxvk {
113111
// Reset the spec constants used...
114112
if (specConstantValue)
115113
m_context->setSpecConstant(VK_PIPELINE_BIND_POINT_COMPUTE, 0, 0);
116-
114+
117115
m_transferCommands += 1;
118116
}
119117

@@ -149,8 +147,8 @@ namespace dxvk {
149147

150148
void D3D9FormatHelper::FlushInternal() {
151149
m_context->flushCommandList();
152-
150+
153151
m_transferCommands = 0;
154152
}
155153

156-
}
154+
}

src/dxso/dxso_compiler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ namespace dxvk {
255255
info.inputMask = m_inputMask;
256256
info.outputMask = m_outputMask;
257257
info.pushConstOffset = m_pushConstOffset;
258-
info.pushConstSize = m_pushConstOffset;
258+
info.pushConstSize = m_pushConstSize;
259259

260260
return new DxvkShader(info, m_module.compile());
261261
}

0 commit comments

Comments
 (0)