GPU: Fix static compilation errors
- Missing explicit cast to `int` for bitwise operator. - UBO struct member macro colision. Rename fixes it.
This commit is contained in:
@@ -11,9 +11,9 @@ void main()
|
||||
half_pixel_offset;
|
||||
|
||||
#ifdef USE_EDGE_SELECT
|
||||
bool is_select = (flag & EDGE_UV_SELECT) != 0u;
|
||||
bool is_select = (flag & int(EDGE_UV_SELECT)) != 0u;
|
||||
#else
|
||||
bool is_select = (flag & VERT_UV_SELECT) != 0u;
|
||||
bool is_select = (flag & int(VERT_UV_SELECT)) != 0u;
|
||||
#endif
|
||||
geom_in.selectionFac = is_select ? 1.0 : 0.0;
|
||||
/* Move selected edges to the top
|
||||
|
||||
@@ -1346,7 +1346,7 @@ void ui_draw_but_UNITVEC(uiBut *but,
|
||||
|
||||
GPUBatch *sphere = GPU_batch_preset_sphere(2);
|
||||
SimpleLightingData simple_lighting_data;
|
||||
copy_v4_fl4(simple_lighting_data.color, diffuse[0], diffuse[1], diffuse[2], 1.0f);
|
||||
copy_v4_fl4(simple_lighting_data.l_color, diffuse[0], diffuse[1], diffuse[2], 1.0f);
|
||||
copy_v3_v3(simple_lighting_data.light, light);
|
||||
GPUUniformBuf *ubo = GPU_uniformbuf_create_ex(
|
||||
sizeof(SimpleLightingData), &simple_lighting_data, __func__);
|
||||
|
||||
@@ -54,7 +54,7 @@ struct GPUClipPlanes {
|
||||
BLI_STATIC_ASSERT_ALIGN(struct GPUClipPlanes, 16)
|
||||
|
||||
struct SimpleLightingData {
|
||||
float4 color;
|
||||
float4 l_color;
|
||||
float3 light;
|
||||
float _pad;
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
void main()
|
||||
{
|
||||
fragColor = simple_lighting_data.color;
|
||||
fragColor = simple_lighting_data.l_color;
|
||||
fragColor.xyz *= clamp(dot(normalize(normal), simple_lighting_data.light), 0.0, 1.0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user