Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[d3d9+dxso] Consider DMAP sampler in bit masks #3627

Merged
merged 1 commit into from
Aug 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[d3d9+dxso] Consider DMAP sampler in bit masks
  • Loading branch information
K0bin committed Aug 20, 2023
commit 585c4feda4277411833eab9d43fd2c25f9a4273a
24 changes: 12 additions & 12 deletions src/d3d9/d3d9_spec_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ namespace dxvk {
enum D3D9SpecConstantId : uint32_t {
SpecSamplerType, // 2 bits for 16 PS samplers | Bits: 32

SpecSamplerDepthMode, // 1 bit for 20 VS + PS samplers | Bits: 20
SpecSamplerDepthMode, // 1 bit for 21 VS + PS samplers | Bits: 21
SpecAlphaCompareOp, // Range: 0 -> 7 | Bits: 3
SpecPointMode, // Range: 0 -> 3 | Bits: 2
SpecVertexFogMode, // Range: 0 -> 3 | Bits: 2
SpecPixelFogMode, // Range: 0 -> 3 | Bits: 2
SpecFogEnabled, // Range: 0 -> 1 | Bits: 1

SpecSamplerNull, // 1 bit for 20 samplers | Bits: 20
SpecSamplerNull, // 1 bit for 21 samplers | Bits: 21
SpecProjectionType, // 1 bit for 6 PS 1.x samplers | Bits: 6
SpecAlphaPrecisionBits, // Range: 0 -> 8 or 0xF | Bits: 4

Expand Down Expand Up @@ -49,16 +49,16 @@ namespace dxvk {
static constexpr std::array<BitfieldPosition, SpecConstantCount> Layout{{
{ 0, 0, 32 }, // SamplerType

{ 1, 0, 20 }, // SamplerDepthMode
{ 1, 20, 3 }, // AlphaCompareOp
{ 1, 23, 2 }, // PointMode
{ 1, 25, 2 }, // VertexFogMode
{ 1, 27, 2 }, // PixelFogMode
{ 1, 29, 1 }, // FogEnabled

{ 2, 0, 20 }, // SamplerNull
{ 2, 20, 6 }, // ProjectionType
{ 2, 26, 4 }, // AlphaPrecisionBits
{ 1, 0, 21 }, // SamplerDepthMode
{ 1, 21, 3 }, // AlphaCompareOp
{ 1, 24, 2 }, // PointMode
{ 1, 26, 2 }, // VertexFogMode
{ 1, 28, 2 }, // PixelFogMode
{ 1, 30, 1 }, // FogEnabled

{ 2, 0, 21 }, // SamplerNull
{ 2, 21, 6 }, // ProjectionType
{ 2, 27, 4 }, // AlphaPrecisionBits

{ 3, 0, 16 }, // VertexShaderBools
{ 3, 16, 16 }, // PixelShaderBools
Expand Down
2 changes: 1 addition & 1 deletion src/dxso/dxso_compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2967,7 +2967,7 @@ void DxsoCompiler::emitControlFlowGenericLoop(

auto SampleType = [&](DxsoSamplerType samplerType) {
uint32_t bitOffset = m_programInfo.type() == DxsoProgramTypes::VertexShader
? samplerIdx + caps::MaxTexturesPS
? samplerIdx + caps::MaxTexturesPS + 1
: samplerIdx;

uint32_t isNull = m_spec.get(m_module, m_specUbo, SpecSamplerNull, bitOffset, 1);
Expand Down