mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-05 04:40:11 +01:00
d3d12: Fixes for QBO shaders
Output offset for resolves was wrong, and we can't use a double for the timestamp multiplier, because doubles might be emulated, and that emulation is only handled by shaders that go through the GL frontend. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26210>
This commit is contained in:
parent
df4fc66649
commit
eac2ce6e3b
4 changed files with 5 additions and 6 deletions
|
|
@ -339,8 +339,7 @@ get_query_resolve(const nir_shader_compiler_options *options, const d3d12_comput
|
|||
nir_def *output_base_index = nir_channel(&b, state_var_data, 3);
|
||||
for (uint32_t i = 0; i < num_result_values; ++i) {
|
||||
/* When resolving in-place, resolve each field, otherwise just write the one result */
|
||||
uint32_t field_offset = key->query_resolve.is_resolve_in_place ?
|
||||
i : key->query_resolve.single_result_field_offset;
|
||||
uint32_t field_offset = key->query_resolve.is_resolve_in_place ? i : 0;
|
||||
|
||||
/* When resolving time elapsed in-place, write [0, time], as the only special case */
|
||||
if (key->query_resolve.is_resolve_in_place &&
|
||||
|
|
@ -353,7 +352,7 @@ get_query_resolve(const nir_shader_compiler_options *options, const d3d12_comput
|
|||
if (!key->query_resolve.is_resolve_in_place &&
|
||||
(key->query_resolve.pipe_query_type == PIPE_QUERY_TIME_ELAPSED ||
|
||||
key->query_resolve.pipe_query_type == PIPE_QUERY_TIMESTAMP)) {
|
||||
result_val = nir_f2u64(&b, nir_fmul_imm(&b, nir_u2f64(&b, result_val), key->query_resolve.timestamp_multiplier));
|
||||
result_val = nir_f2u64(&b, nir_fmul_imm(&b, nir_u2f32(&b, result_val), key->query_resolve.timestamp_multiplier));
|
||||
|
||||
if (!key->query_resolve.is_64bit) {
|
||||
nir_alu_type rounding_type = key->query_resolve.is_signed ? nir_type_int : nir_type_uint;
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ struct d3d12_compute_transform_key
|
|||
uint8_t single_subquery_index : 2;
|
||||
uint8_t single_result_field_offset : 4;
|
||||
uint8_t is_signed : 1;
|
||||
double timestamp_multiplier;
|
||||
float timestamp_multiplier;
|
||||
} query_resolve;
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1572,7 +1572,7 @@ d3d12_init_screen(struct d3d12_screen *screen, IUnknown *adapter)
|
|||
UINT64 timestamp_freq;
|
||||
if (FAILED(screen->cmdqueue->GetTimestampFrequency(×tamp_freq)))
|
||||
timestamp_freq = 10000000;
|
||||
screen->timestamp_multiplier = 1000000000.0 / timestamp_freq;
|
||||
screen->timestamp_multiplier = 1000000000.0f / timestamp_freq;
|
||||
|
||||
d3d12_screen_fence_init(&screen->base);
|
||||
d3d12_screen_resource_init(&screen->base);
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ struct d3d12_screen {
|
|||
uint32_t revision;
|
||||
uint64_t driver_version;
|
||||
uint64_t memory_size_megabytes;
|
||||
double timestamp_multiplier;
|
||||
float timestamp_multiplier;
|
||||
bool have_load_at_vertex;
|
||||
bool support_shader_images;
|
||||
bool support_create_not_resident;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue