File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1501,8 +1501,6 @@ void VulkanDrawManager::drawSphere(material* material_def)
15011501} // namespace vulkan
15021502} // namespace graphics
15031503
1504- // GL_alpha_threshold is defined in gropengl.cpp
1505- extern float GL_alpha_threshold;
15061504
15071505// PostProcessing_override is defined in globalincs/systemvars.cpp
15081506extern bool PostProcessing_override;
@@ -1556,7 +1554,7 @@ void vulkan_set_default_material_uniforms(material* material_info)
15561554 }
15571555
15581556 // Alpha threshold
1559- data->alphaThreshold = GL_alpha_threshold ;
1557+ data->alphaThreshold = getStateTracker ()-> getAlphaThreshold () ;
15601558
15611559 // Color from material
15621560 vec4 clr = material_info->get_color ();
Original file line number Diff line number Diff line change @@ -290,9 +290,6 @@ void VulkanStateTracker::applyDynamicState()
290290} // namespace vulkan
291291} // namespace graphics
292292
293- // GL_alpha_threshold is defined in gropengl.cpp
294- extern float GL_alpha_threshold;
295-
296293namespace graphics {
297294namespace vulkan {
298295
@@ -319,9 +316,9 @@ void vulkan_zbias(int bias)
319316int vulkan_alpha_mask_set (int mode, float alpha)
320317{
321318 if (mode) {
322- GL_alpha_threshold = alpha;
319+ getStateTracker ()-> setAlphaThreshold ( alpha) ;
323320 } else {
324- GL_alpha_threshold = 0 .0f ;
321+ getStateTracker ()-> setAlphaThreshold ( 0 .0f ) ;
325322 }
326323 return mode;
327324}
Original file line number Diff line number Diff line change @@ -176,6 +176,9 @@ class VulkanStateTracker {
176176 void setCullMode (bool enabled) { m_cullEnabled = enabled; }
177177 bool getCullMode () const { return m_cullEnabled; }
178178
179+ void setAlphaThreshold (float threshold) { m_alphaThreshold = threshold; }
180+ float getAlphaThreshold () const { return m_alphaThreshold; }
181+
179182 /* *
180183 * @brief Set color attachment count for current render pass
181184 */
@@ -237,6 +240,7 @@ class VulkanStateTracker {
237240 gr_zbuffer_type m_zbufferMode = ZBUFFER_TYPE_NONE ;
238241 int m_stencilMode = 0 ;
239242 bool m_cullEnabled = true ;
243+ float m_alphaThreshold = 0 .0f ;
240244 uint32_t m_colorAttachmentCount = 1 ;
241245 vk::SampleCountFlagBits m_currentSampleCount = vk::SampleCountFlagBits::e1 ;
242246
You can’t perform that action at this time.
0 commit comments