Remove compute shaders
This commit is contained in:
@@ -11,8 +11,7 @@ import Graphics.GL.Core45
|
||||
import Shader.Data
|
||||
|
||||
data RenderData = RenderData
|
||||
{ _computeShadowShader :: GLuint
|
||||
, _lightingWallShadShader :: Shader
|
||||
{ _lightingWallShadShader :: Shader
|
||||
, _lightingLineShadowShader :: Shader
|
||||
, _lightingCapShader :: Shader
|
||||
, _lightingTextureShader :: Shader
|
||||
|
||||
+1
-1
@@ -185,7 +185,7 @@ graphicsMenuOptions =
|
||||
[ makeEnumOption graphics_world_resolution "World resolution" (uvIOEffects .~ updatePreload)
|
||||
, makeEnumOption graphics_downsize_resolution "Downsize resolution"
|
||||
(uvIOEffects .~ updatePreload)
|
||||
, makeEnumOption graphics_distortion_resolution "Overlay resolution"
|
||||
, makeEnumOption graphics_distortion_resolution "Distortion resolution"
|
||||
(uvIOEffects .~ updatePreload)
|
||||
, makeEnumOption graphics_shadow_rendering "SHADOW RENDERING" id
|
||||
, makeEnumOption graphics_shadow_size "SHADOW DETAIL" id
|
||||
|
||||
@@ -182,15 +182,11 @@ preloadRender = do
|
||||
, eslist
|
||||
]
|
||||
|
||||
-- setup compute shader
|
||||
computeshadowshader <- makeSourcedShader "compute/shadow" [GL_COMPUTE_SHADER]
|
||||
|
||||
initializeGLState
|
||||
putStrLn "Return preload"
|
||||
return $
|
||||
RenderData
|
||||
{ _computeShadowShader = computeshadowshader
|
||||
, _pictureShaders = shadV
|
||||
{ _pictureShaders = shadV
|
||||
, _shapeShader = shapeshader -- & shaderVAO' .~ shPosColVAO
|
||||
, _shapeEBO = shEBO
|
||||
, _silhouetteEBO = shedgeebo
|
||||
|
||||
@@ -44,7 +44,6 @@ createLightMap cfig = case shadrendertype of
|
||||
InstancingShads -> instanceLightMap cfig
|
||||
NoShadows -> const . const . const renderLightingNoShadows
|
||||
NoLighting -> const . const . const . const . const . const renderFlatLighting
|
||||
ComputeShader -> renderComputeShadows
|
||||
_ -> renderShadows shadrendertype
|
||||
where
|
||||
shadrendertype = cfig ^. graphics_shadow_rendering
|
||||
@@ -104,27 +103,6 @@ renderLightingNoShadows positiontexture normaltexture lightPoints pdata = do
|
||||
glDisable GL_CULL_FACE
|
||||
glDisable GL_STENCIL_TEST
|
||||
|
||||
renderComputeShadows ::
|
||||
GLsizei ->
|
||||
Int ->
|
||||
Int ->
|
||||
TO ->
|
||||
TO ->
|
||||
[(Point3, Float, Point3)] ->
|
||||
RenderData ->
|
||||
IO ()
|
||||
renderComputeShadows _ _ _ toPos tanormals lightPoints rd = do
|
||||
withArray (lightsToArray lightPoints) $ \ptr ->
|
||||
glNamedBufferSubData (rd ^. lightsUBO) 0 620 ptr
|
||||
glBindTextureUnit 0 (toPos ^. unTO)
|
||||
glBindTextureUnit 1 (tanormals ^. unTO)
|
||||
glBindImageTexture 5 (rd ^. fboLighting . _2 . unTO) 0 GL_FALSE 0 GL_WRITE_ONLY GL_RGBA8
|
||||
glUseProgram (rd ^. computeShadowShader)
|
||||
glDispatchCompute 800 835 1
|
||||
-- the following should be later, just before the texture is accessed
|
||||
--glMemoryBarrier GL_SHADER_IMAGE_ACCESS_BARRIER_BIT
|
||||
glMemoryBarrier GL_TEXTURE_FETCH_BARRIER_BIT
|
||||
return ()
|
||||
|
||||
renderFlatLighting :: RenderData -> IO ()
|
||||
renderFlatLighting pdata = do
|
||||
|
||||
Reference in New Issue
Block a user