diff options
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r-- | source/blender/gpu/intern/gpu_codegen.cc | 2 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_index_buffer.cc | 2 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_matrix.cc | 6 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_shader_log.cc | 6 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_state.cc | 30 |
5 files changed, 23 insertions, 23 deletions
diff --git a/source/blender/gpu/intern/gpu_codegen.cc b/source/blender/gpu/intern/gpu_codegen.cc index fdd0fe97a02..51644bc9307 100644 --- a/source/blender/gpu/intern/gpu_codegen.cc +++ b/source/blender/gpu/intern/gpu_codegen.cc @@ -874,7 +874,7 @@ void GPU_pass_cache_garbage_collect(void) { static int lasttime = 0; const int shadercollectrate = 60; /* hardcoded for now. */ - int ctime = (int)PIL_check_seconds_timer(); + int ctime = int(PIL_check_seconds_timer()); if (ctime < shadercollectrate + lasttime) { return; diff --git a/source/blender/gpu/intern/gpu_index_buffer.cc b/source/blender/gpu/intern/gpu_index_buffer.cc index 3a66f547403..42f4e048131 100644 --- a/source/blender/gpu/intern/gpu_index_buffer.cc +++ b/source/blender/gpu/intern/gpu_index_buffer.cc @@ -76,7 +76,7 @@ void GPU_indexbuf_init(GPUIndexBufBuilder *builder, #if TRUST_NO_ONE assert(verts_per_prim != -1); #endif - GPU_indexbuf_init_ex(builder, prim_type, prim_len * (uint)verts_per_prim, vertex_len); + GPU_indexbuf_init_ex(builder, prim_type, prim_len * uint(verts_per_prim), vertex_len); } GPUIndexBuf *GPU_indexbuf_build_on_device(uint index_len) diff --git a/source/blender/gpu/intern/gpu_matrix.cc b/source/blender/gpu/intern/gpu_matrix.cc index 94fd44f832b..12bbe13a296 100644 --- a/source/blender/gpu/intern/gpu_matrix.cc +++ b/source/blender/gpu/intern/gpu_matrix.cc @@ -429,7 +429,7 @@ void GPU_matrix_frustum_set( void GPU_matrix_perspective_set(float fovy, float aspect, float near, float far) { - float half_height = tanf(fovy * (float)(M_PI / 360.0)) * near; + float half_height = tanf(fovy * float(M_PI / 360.0)) * near; float half_width = half_height * aspect; GPU_matrix_frustum_set(-half_width, +half_width, -half_height, +half_height, near, far); } @@ -669,13 +669,13 @@ BLI_STATIC_ASSERT(GPU_PY_MATRIX_STACK_LEN + 1 == MATRIX_STACK_DEPTH, "define mis int GPU_matrix_stack_level_get_model_view() { GPUMatrixState *state = Context::get()->matrix_state; - return (int)state->model_view_stack.top; + return int(state->model_view_stack.top); } int GPU_matrix_stack_level_get_projection() { GPUMatrixState *state = Context::get()->matrix_state; - return (int)state->projection_stack.top; + return int(state->projection_stack.top); } /** \} */ diff --git a/source/blender/gpu/intern/gpu_shader_log.cc b/source/blender/gpu/intern/gpu_shader_log.cc index dbc36c5afd0..e593c4fa508 100644 --- a/source/blender/gpu/intern/gpu_shader_log.cc +++ b/source/blender/gpu/intern/gpu_shader_log.cc @@ -93,10 +93,10 @@ void Shader::print_log(Span<const char *> sources, } /* Silence not useful lines. */ - StringRef logref = StringRefNull(log_line).substr(0, (size_t)line_end - (size_t)log_line); + StringRef logref = StringRefNull(log_line).substr(0, size_t(line_end) - size_t(log_line)); if (logref.endswith(" shader failed to compile with the following errors:") || logref.endswith(" No code generated")) { - log_line += (size_t)line_end - (size_t)log_line; + log_line += size_t(line_end) - size_t(log_line); continue; } @@ -291,7 +291,7 @@ bool GPULogParser::at_any(const char *log_line, const StringRef chars) const int GPULogParser::parse_number(const char *log_line, char **r_new_position) const { - return (int)strtol(log_line, r_new_position, 10); + return int(strtol(log_line, r_new_position, 10)); } /** \} */ diff --git a/source/blender/gpu/intern/gpu_state.cc b/source/blender/gpu/intern/gpu_state.cc index a1e0b8867a0..8e9d5cb3184 100644 --- a/source/blender/gpu/intern/gpu_state.cc +++ b/source/blender/gpu/intern/gpu_state.cc @@ -97,10 +97,10 @@ void GPU_color_mask(bool r, bool g, bool b, bool a) StateManager *stack = Context::get()->state_manager; auto &state = stack->state; uint32_t write_mask = state.write_mask; - SET_FLAG_FROM_TEST(write_mask, r, (uint32_t)GPU_WRITE_RED); - SET_FLAG_FROM_TEST(write_mask, g, (uint32_t)GPU_WRITE_GREEN); - SET_FLAG_FROM_TEST(write_mask, b, (uint32_t)GPU_WRITE_BLUE); - SET_FLAG_FROM_TEST(write_mask, a, (uint32_t)GPU_WRITE_ALPHA); + SET_FLAG_FROM_TEST(write_mask, r, uint32_t(GPU_WRITE_RED)); + SET_FLAG_FROM_TEST(write_mask, g, uint32_t(GPU_WRITE_GREEN)); + SET_FLAG_FROM_TEST(write_mask, b, uint32_t(GPU_WRITE_BLUE)); + SET_FLAG_FROM_TEST(write_mask, a, uint32_t(GPU_WRITE_ALPHA)); state.write_mask = write_mask; } @@ -109,7 +109,7 @@ void GPU_depth_mask(bool depth) StateManager *stack = Context::get()->state_manager; auto &state = stack->state; uint32_t write_mask = state.write_mask; - SET_FLAG_FROM_TEST(write_mask, depth, (uint32_t)GPU_WRITE_DEPTH); + SET_FLAG_FROM_TEST(write_mask, depth, uint32_t(GPU_WRITE_DEPTH)); state.write_mask = write_mask; } @@ -133,13 +133,13 @@ void GPU_state_set(eGPUWriteMask write_mask, { StateManager *stack = Context::get()->state_manager; auto &state = stack->state; - state.write_mask = (uint32_t)write_mask; - state.blend = (uint32_t)blend; - state.culling_test = (uint32_t)culling_test; - state.depth_test = (uint32_t)depth_test; - state.stencil_test = (uint32_t)stencil_test; - state.stencil_op = (uint32_t)stencil_op; - state.provoking_vert = (uint32_t)provoking_vert; + state.write_mask = uint32_t(write_mask); + state.blend = uint32_t(blend); + state.culling_test = uint32_t(culling_test); + state.depth_test = uint32_t(depth_test); + state.stencil_test = uint32_t(stencil_test); + state.stencil_op = uint32_t(stencil_op); + state.provoking_vert = uint32_t(provoking_vert); } /** \} */ @@ -196,17 +196,17 @@ void GPU_viewport(int x, int y, int width, int height) void GPU_stencil_reference_set(uint reference) { - SET_MUTABLE_STATE(stencil_reference, (uint8_t)reference); + SET_MUTABLE_STATE(stencil_reference, uint8_t(reference)); } void GPU_stencil_write_mask_set(uint write_mask) { - SET_MUTABLE_STATE(stencil_write_mask, (uint8_t)write_mask); + SET_MUTABLE_STATE(stencil_write_mask, uint8_t(write_mask)); } void GPU_stencil_compare_mask_set(uint compare_mask) { - SET_MUTABLE_STATE(stencil_compare_mask, (uint8_t)compare_mask); + SET_MUTABLE_STATE(stencil_compare_mask, uint8_t(compare_mask)); } /** \} */ |