mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 13:10:10 +01:00
d3d12: Convert from D3D shader model to Mesa shader model earlier
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22952>
This commit is contained in:
parent
7cdbf4f065
commit
9dc009e7ae
4 changed files with 8 additions and 6 deletions
|
|
@ -166,9 +166,7 @@ compile_nir(struct d3d12_context *ctx, struct d3d12_shader_selector *sel,
|
|||
opts.provoking_vertex = key->fs.provoking_vertex;
|
||||
opts.input_clip_size = key->input_clip_size;
|
||||
opts.environment = DXIL_ENVIRONMENT_GL;
|
||||
static_assert(D3D_SHADER_MODEL_6_0 == 0x60 && SHADER_MODEL_6_0 == 0x60000, "Validating math below");
|
||||
static_assert(D3D_SHADER_MODEL_6_7 == 0x67 && SHADER_MODEL_6_7 == 0x60007, "Validating math below");
|
||||
opts.shader_model_max = static_cast<dxil_shader_model>(((screen->max_shader_model & 0xf0) << 12) | (screen->max_shader_model & 0xf));
|
||||
opts.shader_model_max = screen->max_shader_model;
|
||||
#ifdef _WIN32
|
||||
opts.validator_version_max = dxil_get_validator_version(ctx->dxil_validator);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1509,7 +1509,10 @@ d3d12_init_screen(struct d3d12_screen *screen, IUnknown *adapter)
|
|||
for (UINT i = 0; i < ARRAY_SIZE(valid_shader_models); ++i) {
|
||||
D3D12_FEATURE_DATA_SHADER_MODEL shader_model = { valid_shader_models[i] };
|
||||
if (SUCCEEDED(screen->dev->CheckFeatureSupport(D3D12_FEATURE_SHADER_MODEL, &shader_model, sizeof(shader_model)))) {
|
||||
screen->max_shader_model = shader_model.HighestShaderModel;
|
||||
static_assert(D3D_SHADER_MODEL_6_0 == 0x60 && SHADER_MODEL_6_0 == 0x60000, "Validating math below");
|
||||
static_assert(D3D_SHADER_MODEL_6_7 == 0x67 && SHADER_MODEL_6_7 == 0x60007, "Validating math below");
|
||||
screen->max_shader_model = static_cast<dxil_shader_model>(((shader_model.HighestShaderModel & 0xf0) << 12) |
|
||||
(shader_model.HighestShaderModel & 0xf));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
#include "d3d12_descriptor_pool.h"
|
||||
|
||||
#include "nir.h"
|
||||
#include "dxil_versions.h"
|
||||
|
||||
#include "d3d12_common.h"
|
||||
|
||||
|
|
@ -108,7 +109,7 @@ struct d3d12_screen {
|
|||
|
||||
/* capabilities */
|
||||
D3D_FEATURE_LEVEL max_feature_level;
|
||||
D3D_SHADER_MODEL max_shader_model;
|
||||
enum dxil_shader_model max_shader_model;
|
||||
D3D12_FEATURE_DATA_ARCHITECTURE architecture;
|
||||
D3D12_FEATURE_DATA_D3D12_OPTIONS opts;
|
||||
D3D12_FEATURE_DATA_D3D12_OPTIONS1 opts1;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ libd3d12winsys = static_library(
|
|||
'd3d12winsys',
|
||||
files_libd3d12winsys,
|
||||
include_directories : [inc_src, inc_wgl, inc_include, inc_gallium, inc_gallium_aux, inc_gallium_drivers],
|
||||
dependencies : [dep_dxheaders, idep_nir_headers],
|
||||
dependencies : [dep_dxheaders, idep_nir_headers, idep_libdxil_compiler],
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue